Merge branch 'master' into feat/uniswap-adapter-flashloan

# Conflicts:
#	helpers/contracts-getters.ts
#	helpers/types.ts
This commit is contained in:
Gerardo Nardelli 2020-11-10 11:40:25 -03:00
commit a7115f019e
39 changed files with 1883 additions and 994 deletions

View File

@ -14,7 +14,6 @@ usePlugin('buidler-typechain');
usePlugin('solidity-coverage');
usePlugin('@nomiclabs/buidler-waffle');
usePlugin('@nomiclabs/buidler-etherscan');
usePlugin('buidler-gas-reporter');
const SKIP_LOAD = process.env.SKIP_LOAD === 'true';
const DEFAULT_BLOCK_GAS_LIMIT = 12450000;

View File

@ -34,100 +34,100 @@ export const AaveConfig: IAaveConfiguration = {
ConfigName: 'Aave',
ProviderId: 1,
ReservesConfig: {
DAI: stablecoinStrategyDAI,
TUSD: stablecoinStrategyTUSD,
USDC: stablecoinStrategyUSDC,
USDT: stablecoinStrategyUSDT,
SUSD: stablecoinStrategySUSD,
AAVE: strategyAAVE,
BAT: strategyBase,
WETH: strategyWETH,
LINK: strategyLINK,
WBTC: strategyWBTC,
KNC: strategyKNC,
REP: strategyREP,
MKR: strategyMKR,
MANA: strategyMANA,
ZRX: strategyBase,
SNX: strategySNX,
YFI: strategyYFI,
UNI: strategyUNI,
BUSD: stablecoinStrategyBUSD,
REN: strategyREN,
DAI: stablecoinStrategyDAI,
ENJ: strategyREN,
KNC: strategyKNC,
LINK: strategyLINK,
MANA: strategyMANA,
MKR: strategyMKR,
REN: strategyREN,
REP: strategyREP,
SNX: strategySNX,
SUSD: stablecoinStrategySUSD,
TUSD: stablecoinStrategyTUSD,
UNI: strategyUNI,
USDC: stablecoinStrategyUSDC,
USDT: stablecoinStrategyUSDT,
WBTC: strategyWBTC,
WETH: strategyWETH,
YFI: strategyYFI,
ZRX: strategyBase,
},
ReserveAssets: {
[eEthereumNetwork.buidlerevm]: {},
[eEthereumNetwork.hardhat]: {},
[eEthereumNetwork.coverage]: {},
[EthereumNetwork.kovan]: {
WETH: '0xd0a1e359811322d97991e03f863a0c30c2cf029c',
DAI: '0xFf795577d9AC8bD7D90Ee22b6C1703490b6512FD',
TUSD: '0x016750AC630F711882812f24Dba6c95b9D35856d',
USDC: '0xe22da380ee6B445bb8273C81944ADEB6E8450422',
USDT: '0x13512979ADE267AB5100878E2e0f485B568328a4',
SUSD: '0xD868790F57B39C9B2B51b12de046975f986675f9',
AAVE: '0xB597cd8D3217ea6477232F9217fa70837ff667Af',
BAT: '0x2d12186Fbb9f9a8C28B3FfdD4c42920f8539D738',
REP: '0x260071C8D61DAf730758f8BD0d6370353956AE0E',
MKR: '0x61e4CAE3DA7FD189e52a4879C7B8067D7C2Cc0FA',
LINK: '0xAD5ce863aE3E4E9394Ab43d4ba0D80f419F61789',
KNC: '0x3F80c39c0b96A0945f9F0E9f55d8A8891c5671A8',
WBTC: '0xD1B98B6607330172f1D991521145A22BCe793277',
MANA: '0x738Dc6380157429e957d223e6333Dc385c85Fec7',
ZRX: '0xD0d76886cF8D952ca26177EB7CfDf83bad08C00C',
SNX: '0x7FDb81B0b8a010dd4FFc57C3fecbf145BA8Bd947',
BUSD: '0x4c6E1EFC12FDfD568186b7BAEc0A43fFfb4bCcCf',
REN: '0x5eebf65A6746eed38042353Ba84c8e37eD58Ac6f',
YFI: '0xb7c325266ec274fEb1354021D27FA3E3379D840d',
UNI: '0x075A36BA8846C6B6F53644fDd3bf17E5151789DC',
DAI: '0xFf795577d9AC8bD7D90Ee22b6C1703490b6512FD',
ENJ: '0xC64f90Cd7B564D3ab580eb20a102A8238E218be2',
KNC: '0x3F80c39c0b96A0945f9F0E9f55d8A8891c5671A8',
LINK: '0xAD5ce863aE3E4E9394Ab43d4ba0D80f419F61789',
MANA: '0x738Dc6380157429e957d223e6333Dc385c85Fec7',
MKR: '0x61e4CAE3DA7FD189e52a4879C7B8067D7C2Cc0FA',
REN: '0x5eebf65A6746eed38042353Ba84c8e37eD58Ac6f',
REP: '0x260071C8D61DAf730758f8BD0d6370353956AE0E',
SNX: '0x7FDb81B0b8a010dd4FFc57C3fecbf145BA8Bd947',
SUSD: '0xD868790F57B39C9B2B51b12de046975f986675f9',
TUSD: '0x016750AC630F711882812f24Dba6c95b9D35856d',
UNI: '0x075A36BA8846C6B6F53644fDd3bf17E5151789DC',
USDC: '0xe22da380ee6B445bb8273C81944ADEB6E8450422',
USDT: '0x13512979ADE267AB5100878E2e0f485B568328a4',
WBTC: '0xD1B98B6607330172f1D991521145A22BCe793277',
WETH: '0xd0a1e359811322d97991e03f863a0c30c2cf029c',
YFI: '0xb7c325266ec274fEb1354021D27FA3E3379D840d',
ZRX: '0xD0d76886cF8D952ca26177EB7CfDf83bad08C00C',
},
[EthereumNetwork.ropsten]: {
WETH: '0xc778417e063141139fce010982780140aa0cd5ab',
DAI: '0xf80A32A835F79D7787E8a8ee5721D0fEaFd78108',
TUSD: '0xa2EA00Df6d8594DBc76b79beFe22db9043b8896F',
USDC: '0x851dEf71f0e6A903375C1e536Bd9ff1684BAD802',
USDT: '0xB404c51BBC10dcBE948077F18a4B8E553D160084',
SUSD: '0xc374eB17f665914c714Ac4cdC8AF3a3474228cc5',
AAVE: '',
BAT: '0x85B24b3517E3aC7bf72a14516160541A60cFF19d',
REP: '0xBeb13523503d35F9b3708ca577CdCCAdbFB236bD',
MKR: '0x2eA9df3bABe04451c9C3B06a2c844587c59d9C37',
LINK: '0x1a906E71FF9e28d8E01460639EB8CF0a6f0e2486',
KNC: '0xCe4aA1dE3091033Ba74FA2Ad951f6adc5E5cF361',
WBTC: '0xa0E54Ab6AA5f0bf1D62EC3526436F3c05b3348A0',
MANA: '0x78b1F763857C8645E46eAdD9540882905ff32Db7',
ZRX: '0x02d7055704EfF050323A2E5ee4ba05DB2A588959',
SNX: '0xF80Aa7e2Fda4DA065C55B8061767F729dA1476c7',
BUSD: '0xFA6adcFf6A90c11f31Bc9bb59eC0a6efB38381C6',
REN: ZERO_ADDRESS,
YFI: ZERO_ADDRESS,
UNI: ZERO_ADDRESS,
DAI: '0xf80A32A835F79D7787E8a8ee5721D0fEaFd78108',
ENJ: ZERO_ADDRESS,
KNC: '0xCe4aA1dE3091033Ba74FA2Ad951f6adc5E5cF361',
LINK: '0x1a906E71FF9e28d8E01460639EB8CF0a6f0e2486',
MANA: '0x78b1F763857C8645E46eAdD9540882905ff32Db7',
MKR: '0x2eA9df3bABe04451c9C3B06a2c844587c59d9C37',
REN: ZERO_ADDRESS,
REP: '0xBeb13523503d35F9b3708ca577CdCCAdbFB236bD',
SNX: '0xF80Aa7e2Fda4DA065C55B8061767F729dA1476c7',
SUSD: '0xc374eB17f665914c714Ac4cdC8AF3a3474228cc5',
TUSD: '0xa2EA00Df6d8594DBc76b79beFe22db9043b8896F',
UNI: ZERO_ADDRESS,
USDC: '0x851dEf71f0e6A903375C1e536Bd9ff1684BAD802',
USDT: '0xB404c51BBC10dcBE948077F18a4B8E553D160084',
WBTC: '0xa0E54Ab6AA5f0bf1D62EC3526436F3c05b3348A0',
WETH: '0xc778417e063141139fce010982780140aa0cd5ab',
YFI: ZERO_ADDRESS,
ZRX: '0x02d7055704EfF050323A2E5ee4ba05DB2A588959',
},
[EthereumNetwork.main]: {
WETH: '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2',
DAI: '0x6b175474e89094c44da98b954eedeac495271d0f',
TUSD: '0x0000000000085d4780B73119b644AE5ecd22b376',
USDC: '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48',
USDT: '0xdac17f958d2ee523a2206206994597c13d831ec7',
SUSD: '0x57ab1ec28d129707052df4df418d58a2d46d5f51',
AAVE: '0x7Fc66500c84A76Ad7e9c93437bFc5Ac33E2DDaE9',
BAT: '0x0d8775f648430679a709e98d2b0cb6250d2887ef',
REP: '0x1985365e9f78359a9B6AD760e32412f4a445E862',
MKR: '0x9f8f72aa9304c8b593d555f12ef6589cc3a579a2',
LINK: '0x514910771af9ca656af840dff83e8264ecf986ca',
KNC: '0xdd974d5c2e2928dea5f71b9825b8b646686bd200',
WBTC: '0x2260fac5e5542a773aa44fbcfedf7c193bc2c599',
MANA: '0x0f5d2fb29fb7d3cfee444a200298f468908cc942',
ZRX: '0xe41d2489571d322189246dafa5ebde1f4699f498',
SNX: '0xC011a73ee8576Fb46F5E1c5751cA3B9Fe0af2a6F',
BUSD: '0x4Fabb145d64652a948d72533023f6E7A623C7C53',
REN: '0x408e41876cCCDC0F92210600ef50372656052a38',
YFI: '0x0bc529c00C6401aEF6D220BE8C6Ea1667F6Ad93e',
UNI: '0x1f9840a85d5aF5bf1D1762F925BDADdC4201F984',
DAI: '0x6b175474e89094c44da98b954eedeac495271d0f',
ENJ: '0xF629cBd94d3791C9250152BD8dfBDF380E2a3B9c',
KNC: '0xdd974d5c2e2928dea5f71b9825b8b646686bd200',
LINK: '0x514910771af9ca656af840dff83e8264ecf986ca',
MANA: '0x0f5d2fb29fb7d3cfee444a200298f468908cc942',
MKR: '0x9f8f72aa9304c8b593d555f12ef6589cc3a579a2',
REN: '0x408e41876cCCDC0F92210600ef50372656052a38',
REP: '0x1985365e9f78359a9B6AD760e32412f4a445E862',
SNX: '0xC011a73ee8576Fb46F5E1c5751cA3B9Fe0af2a6F',
SUSD: '0x57ab1ec28d129707052df4df418d58a2d46d5f51',
TUSD: '0x0000000000085d4780B73119b644AE5ecd22b376',
UNI: '0x1f9840a85d5aF5bf1D1762F925BDADdC4201F984',
USDC: '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48',
USDT: '0xdac17f958d2ee523a2206206994597c13d831ec7',
WBTC: '0x2260fac5e5542a773aa44fbcfedf7c193bc2c599',
WETH: '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2',
YFI: '0x0bc529c00C6401aEF6D220BE8C6Ea1667F6Ad93e',
ZRX: '0xe41d2489571d322189246dafa5ebde1f4699f498',
},
},
};

View File

@ -4,28 +4,28 @@ import {oneEther, oneRay, RAY, ZERO_ADDRESS} from '../helpers/constants';
import {ICommonConfiguration, EthereumNetwork, eEthereumNetwork} from '../helpers/types';
const MOCK_CHAINLINK_AGGREGATORS_PRICES = {
DAI: oneEther.multipliedBy('0.00369068412860').toFixed(),
TUSD: oneEther.multipliedBy('0.00364714136416').toFixed(),
USDC: oneEther.multipliedBy('0.00367714136416').toFixed(),
AAVE: oneEther.multipliedBy('0.003620948469').toFixed(),
BAT: oneEther.multipliedBy('0.00137893825230').toFixed(),
USDT: oneEther.multipliedBy('0.00369068412860').toFixed(),
SUSD: oneEther.multipliedBy('0.00364714136416').toFixed(),
MKR: oneEther.multipliedBy('2.508581').toFixed(),
REP: oneEther.multipliedBy('0.048235').toFixed(),
ZRX: oneEther.multipliedBy('0.001151').toFixed(),
WBTC: oneEther.multipliedBy('47.332685').toFixed(),
LINK: oneEther.multipliedBy('0.009955').toFixed(),
KNC: oneEther.multipliedBy('0.001072').toFixed(),
MANA: oneEther.multipliedBy('0.000158').toFixed(),
SNX: oneEther.multipliedBy('0.00442616').toFixed(),
BUSD: oneEther.multipliedBy('0.00736484').toFixed(),
WETH: oneEther.toFixed(),
USD: '5848466240000000',
YFI: oneEther.multipliedBy('22.407436').toFixed(),
REN: oneEther.multipliedBy('0.00065133').toFixed(),
UNI: oneEther.multipliedBy('0.00536479').toFixed(),
DAI: oneEther.multipliedBy('0.00369068412860').toFixed(),
ENJ: oneEther.multipliedBy('0.00029560').toFixed(),
KNC: oneEther.multipliedBy('0.001072').toFixed(),
LINK: oneEther.multipliedBy('0.009955').toFixed(),
MANA: oneEther.multipliedBy('0.000158').toFixed(),
MKR: oneEther.multipliedBy('2.508581').toFixed(),
REN: oneEther.multipliedBy('0.00065133').toFixed(),
REP: oneEther.multipliedBy('0.048235').toFixed(),
SNX: oneEther.multipliedBy('0.00442616').toFixed(),
SUSD: oneEther.multipliedBy('0.00364714136416').toFixed(),
TUSD: oneEther.multipliedBy('0.00364714136416').toFixed(),
UNI: oneEther.multipliedBy('0.00536479').toFixed(),
USDC: oneEther.multipliedBy('0.00367714136416').toFixed(),
USDT: oneEther.multipliedBy('0.00369068412860').toFixed(),
WETH: oneEther.toFixed(),
WBTC: oneEther.multipliedBy('47.332685').toFixed(),
YFI: oneEther.multipliedBy('22.407436').toFixed(),
ZRX: oneEther.multipliedBy('0.001151').toFixed(),
USD: '5848466240000000',
UNI_DAI_ETH: oneEther.multipliedBy('2.1').toFixed(),
UNI_USDC_ETH: oneEther.multipliedBy('2.1').toFixed(),
UNI_SETH_ETH: oneEther.multipliedBy('2.1').toFixed(),
@ -65,6 +65,7 @@ export const CommonsConfig: ICommonConfiguration = {
...MOCK_CHAINLINK_AGGREGATORS_PRICES,
},
},
// TODO: reorg alphabetically, checking the reason of tests failing
LendingRateOracleRatesCommon: {
WETH: {
borrowRate: oneRay.multipliedBy(0.03).toFixed(),
@ -196,91 +197,91 @@ export const CommonsConfig: ICommonConfiguration = {
[eEthereumNetwork.hardhat]: {},
[eEthereumNetwork.buidlerevm]: {},
[EthereumNetwork.kovan]: {
DAI: '0x6F47077D3B6645Cb6fb7A29D280277EC1e5fFD90',
TUSD: '0x02424c54D78D48179Fd12ebFfB11c16f9CA984Ad',
USDC: '0x672c1C0d1130912D83664011E7960a42E8cA05D5',
USDT: '0xCC833A6522721B3252e7578c5BCAF65738B75Fc3',
SUSD: '0xa353F8b083F7575cfec443b5ad585D42f652E9F7',
AAVE: '0xd04647B7CB523bb9f26730E9B6dE1174db7591Ad',
BAT: '0x2c8d01771CCDca47c103194C5860dbEA2fE61626',
REP: '0x09F4A94F44c29d4967C761bBdB89f5bD3E2c09E6',
MKR: '0x14D7714eC44F44ECD0098B39e642b246fB2c38D0',
LINK: '0xf1e71Afd1459C05A2F898502C4025be755aa844A',
KNC: '0x0893AaF58f62279909F9F6FF2E5642f53342e77F',
WBTC: '0x33E5085E92f5b53E9A193E28ad2f76bF210550BB',
MANA: '0x3c30c5c415B2410326297F0f65f5Cbb32f3aefCc',
ZRX: '0x2636cfdDB457a6C7A7D60A439F1E5a5a0C3d9c65',
SNX: '0x775E76cca1B5bc903c9a8C6f77416A35E5744664',
BUSD: '0x63294A05C9a81b1A40CAD3f2ff30617111630393',
USD: '0xD21912D8762078598283B14cbA40Cb4bFCb87581',
YFI: '0xe45f3ed2218E7e411bf8DFdE66069e57F46b26eF',
REN: '0xF1939BECE7708382b5fb5e559f630CB8B39a10ee',
UNI: '0x17756515f112429471F86f98D5052aCB6C47f6ee',
BAT: '0x0e4fcEC26c9f85c3D714370c98f43C4E02Fc35Ae',
BUSD: '0xbF7A18ea5DE0501f7559144e702b29c55b055CcB',
DAI: '0x22B58f1EbEDfCA50feF632bD73368b2FdA96D541',
ENJ: '0xfaDbe2ee798889F02d1d39eDaD98Eff4c7fe95D4',
KNC: '0xb8E8130d244CFd13a75D6B9Aee029B1C33c808A7',
LINK: '0x3Af8C569ab77af5230596Acf0E8c2F9351d24C38',
MANA: '0x1b93D8E109cfeDcBb3Cc74eD761DE286d5771511',
MKR: '0x0B156192e04bAD92B6C1C13cf8739d14D78D5701',
REN: '0xF1939BECE7708382b5fb5e559f630CB8B39a10ee',
REP: '0x3A7e6117F2979EFf81855de32819FBba48a63e9e',
SNX: '0xF9A76ae7a1075Fe7d646b06fF05Bd48b9FA5582e',
SUSD: '0xb343e7a1aF578FA35632435243D814e7497622f7',
TUSD: '0x7aeCF1c19661d12E962b69eBC8f6b2E63a55C660',
UNI: '0x17756515f112429471F86f98D5052aCB6C47f6ee',
USDC: '0x64EaC61A2DFda2c3Fa04eED49AA33D021AeC8838',
USDT: '0x0bF499444525a23E7Bb61997539725cA2e928138',
WBTC: '0xF7904a295A029a3aBDFFB6F12755974a958C7C25',
YFI: '0xC5d1B1DEb2992738C0273408ac43e1e906086B6C',
ZRX: '0xBc3f28Ccc21E9b5856E81E6372aFf57307E2E883',
USD: '0x9326BFA02ADD2366b30bacB125260Af641031331',
UNI_DAI_ETH: '0x0338C40020Bf886c11406115fD1ba205Ef1D9Ff9',
UNI_USDC_ETH: '0x7f5E5D34591e9a70D187BBA94260C30B92aC0961',
UNI_SETH_ETH: '0xc5F1eA001c1570783b3af418fa775237Eb129EDC',
UNI_LEND_ETH: '0xB996b1a11BA0aACc4deA57f7f92d1722428f2E90',
UNI_LINK_ETH: '0x267490eE9Ad21dfE839aE73A8B1c8C9A36F60d33',
UNI_MKR_ETH: '0x6eBF25AB0A18B8F6243619f1AE6b94373169A069',
UNI_SETH_ETH: '0xc5F1eA001c1570783b3af418fa775237Eb129EDC',
UNI_USDC_ETH: '0x7f5E5D34591e9a70D187BBA94260C30B92aC0961',
},
[EthereumNetwork.ropsten]: {
AAVE: ZERO_ADDRESS,
BAT: '0xafd8186c962daf599f171b8600f3e19af7b52c92',
BUSD: '0x0A32D96Ff131cd5c3E0E5AAB645BF009Eda61564',
DAI: '0x64b8e49baded7bfb2fd5a9235b2440c0ee02971b',
ENJ: ZERO_ADDRESS,
KNC: '0x19d97ceb36624a31d827032d8216dd2eb15e9845',
LINK: '0xb8c99b98913bE2ca4899CdcaF33a3e519C20EeEc',
MANA: '0xDab909dedB72573c626481fC98CEE1152b81DEC2',
MKR: '0x811B1f727F8F4aE899774B568d2e72916D91F392',
REN: ZERO_ADDRESS,
REP: '0xa949ee9ba80c0f381481f2eab538bc5547a5ac67',
SNX: '0xA95674a8Ed9aa9D2E445eb0024a9aa05ab44f6bf',
SUSD: '0xe054b4aee7ac7645642dd52f1c892ff0128c98f0',
TUSD: '0x523ac85618df56e940534443125ef16daf785620',
UNI: ZERO_ADDRESS,
USDC: '0xe1480303dde539e2c241bdc527649f37c9cbef7d',
USDT: '0xc08fe0c4d97ccda6b40649c6da621761b628c288',
SUSD: '0xe054b4aee7ac7645642dd52f1c892ff0128c98f0',
AAVE: '',
BAT: '0xafd8186c962daf599f171b8600f3e19af7b52c92',
REP: '0xa949ee9ba80c0f381481f2eab538bc5547a5ac67',
MKR: '0x811B1f727F8F4aE899774B568d2e72916D91F392',
LINK: '0xb8c99b98913bE2ca4899CdcaF33a3e519C20EeEc',
KNC: '0x19d97ceb36624a31d827032d8216dd2eb15e9845',
WBTC: '0x5b8B87A0abA4be247e660B0e0143bB30Cdf566AF',
MANA: '0xDab909dedB72573c626481fC98CEE1152b81DEC2',
ZRX: '0x1d0052e4ae5b4ae4563cbac50edc3627ca0460d7',
SNX: '0xA95674a8Ed9aa9D2E445eb0024a9aa05ab44f6bf',
BUSD: '0x0A32D96Ff131cd5c3E0E5AAB645BF009Eda61564',
USD: '0x8468b2bDCE073A157E560AA4D9CcF6dB1DB98507',
YFI: ZERO_ADDRESS,
REN: ZERO_ADDRESS,
UNI: ZERO_ADDRESS,
ENJ: ZERO_ADDRESS,
ZRX: '0x1d0052e4ae5b4ae4563cbac50edc3627ca0460d7',
UNI_DAI_ETH: '0x16048819e3f77b7112eB033624A0bA9d33743028',
UNI_USDC_ETH: '0x6952A2678D574073DB97963886c2F38CD09C8Ba3',
UNI_SETH_ETH: '0x23Ee5188806BD2D31103368B0EA0259bc6706Af1',
UNI_LEND_ETH: '0x43c44B27376Afedee06Bae2A003e979FC3B3Da6C',
UNI_LINK_ETH: '0xb60c29714146EA3539261f599Eb30f62904108Fa',
UNI_MKR_ETH: '0x594ae5421f378b8B4AF9e758C461d2A1FF990BC5',
UNI_SETH_ETH: '0x23Ee5188806BD2D31103368B0EA0259bc6706Af1',
UNI_USDC_ETH: '0x6952A2678D574073DB97963886c2F38CD09C8Ba3',
USD: '0x8468b2bDCE073A157E560AA4D9CcF6dB1DB98507',
},
[EthereumNetwork.main]: {
DAI: '0x037E8F2125bF532F3e228991e051c8A7253B642c',
TUSD: '0x73ead35fd6A572EF763B13Be65a9db96f7643577',
USDC: '0xdE54467873c3BCAA76421061036053e371721708',
USDT: '0xa874fe207DF445ff19E7482C746C4D3fD0CB9AcE',
SUSD: '0x6d626Ff97f0E89F6f983dE425dc5B24A18DE26Ea',
AAVE: '0x6Df09E975c830ECae5bd4eD9d90f3A95a4f88012',
BAT: '0x9b4e2579895efa2b4765063310Dc4109a7641129',
REP: '0xb8b513d9cf440C1b6f5C7142120d611C94fC220c',
MKR: '0xda3d675d50ff6c555973c4f0424964e1f6a4e7d3',
LINK: '0xeCfA53A8bdA4F0c4dd39c55CC8deF3757aCFDD07',
KNC: '0xd0e785973390fF8E77a83961efDb4F271E6B8152',
WBTC: '0x0133Aa47B6197D0BA090Bf2CD96626Eb71fFd13c',
MANA: '0xc89c4ed8f52Bb17314022f6c0dCB26210C905C97',
ZRX: '0xA0F9D94f060836756FFC84Db4C78d097cA8C23E8',
SNX: '0xE23d1142dE4E83C08bb048bcab54d50907390828',
BUSD: '0x5d4BB541EED49D0290730b4aB332aA46bd27d888',
USD: '0x59b826c214aBa7125bFA52970d97736c105Cc375',
YFI: '0x7c5d4F8345e66f68099581Db340cd65B078C41f4',
REN: '0x3147D7203354Dc06D9fd350c7a2437bcA92387a4',
UNI: '0xD6aA3D25116d8dA79Ea0246c4826EB951872e02e',
DAI: '0x037E8F2125bF532F3e228991e051c8A7253B642c',
ENJ: '0x24D9aB51950F3d62E9144fdC2f3135DAA6Ce8D1B',
KNC: '0xd0e785973390fF8E77a83961efDb4F271E6B8152',
LINK: '0xeCfA53A8bdA4F0c4dd39c55CC8deF3757aCFDD07',
MANA: '0xc89c4ed8f52Bb17314022f6c0dCB26210C905C97',
MKR: '0xda3d675d50ff6c555973c4f0424964e1f6a4e7d3',
REN: '0x3147D7203354Dc06D9fd350c7a2437bcA92387a4',
REP: '0xb8b513d9cf440C1b6f5C7142120d611C94fC220c',
SNX: '0xE23d1142dE4E83C08bb048bcab54d50907390828',
SUSD: '0x6d626Ff97f0E89F6f983dE425dc5B24A18DE26Ea',
TUSD: '0x73ead35fd6A572EF763B13Be65a9db96f7643577',
UNI: '0xD6aA3D25116d8dA79Ea0246c4826EB951872e02e',
USDC: '0xdE54467873c3BCAA76421061036053e371721708',
USDT: '0xa874fe207DF445ff19E7482C746C4D3fD0CB9AcE',
WBTC: '0x0133Aa47B6197D0BA090Bf2CD96626Eb71fFd13c',
YFI: '0x7c5d4F8345e66f68099581Db340cd65B078C41f4',
ZRX: '0xA0F9D94f060836756FFC84Db4C78d097cA8C23E8',
UNI_DAI_ETH: '0x1bAB293850289Bf161C5DA79ff3d1F02A950555b',
UNI_USDC_ETH: '0x444315Ee92F2bb3579293C17B07194227fA99bF0',
UNI_SETH_ETH: '0x517D40E49660c7705b2e99eEFA6d7B0E9Ba5BF10',
UNI_LEND_ETH: '0xF4C8Db2d999b024bBB6c6022566503eD41f2AC1E',
UNI_LINK_ETH: '0xE2A639Beb647d7F709ca805ABa760bBEfdbE37e3',
UNI_MKR_ETH: '0xEe40a5E8F3732bE6ECDb5A90e23D0b7bF0D4a73c',
UNI_SETH_ETH: '0x517D40E49660c7705b2e99eEFA6d7B0E9Ba5BF10',
UNI_USDC_ETH: '0x444315Ee92F2bb3579293C17B07194227fA99bF0',
USD: '0x59b826c214aBa7125bFA52970d97736c105Cc375',
},
},
ReserveAssets: {
@ -296,9 +297,9 @@ export const CommonsConfig: ICommonConfiguration = {
[eEthereumNetwork.coverage]:
'0x95b73a72c6ecf4ccbbba5178800023260bad8e75cdccdb8e4827a2977a37c820',
[eEthereumNetwork.hardhat]:
'0x92d0d54f437b6e70937ecba8ac80fc3b6767cf26bc725820e937d5a78427c2d1',
'0xa14895ab432a9d0712a041fdcea77f7f65826945dc90bf29ea819c2a01e7c5f9',
[eEthereumNetwork.buidlerevm]:
'0x92d0d54f437b6e70937ecba8ac80fc3b6767cf26bc725820e937d5a78427c2d1',
'0xa14895ab432a9d0712a041fdcea77f7f65826945dc90bf29ea819c2a01e7c5f9',
[eEthereumNetwork.kovan]: '',
[eEthereumNetwork.ropsten]: '',
[eEthereumNetwork.main]: '',

View File

@ -16,6 +16,20 @@ export const strategyBase: IReserveParams = {
reserveDecimals: '18',
};
export const stablecoinStrategyBase: IReserveParams = {
baseVariableBorrowRate: new BigNumber(0.01).multipliedBy(oneRay).toFixed(),
variableRateSlope1: new BigNumber(0.07).multipliedBy(oneRay).toFixed(),
variableRateSlope2: new BigNumber(1.5).multipliedBy(oneRay).toFixed(),
stableRateSlope1: new BigNumber(0.06).multipliedBy(oneRay).toFixed(),
stableRateSlope2: new BigNumber(1.5).multipliedBy(oneRay).toFixed(),
baseLTVAsCollateral: '7500',
liquidationThreshold: '8000',
liquidationBonus: '10500',
borrowingEnabled: true,
stableBorrowRateEnabled: true,
reserveDecimals: '18',
};
export const stablecoinStrategyCentralized: IReserveParams = {
baseVariableBorrowRate: new BigNumber(0.01).multipliedBy(oneRay).toFixed(),
variableRateSlope1: new BigNumber(0.07).multipliedBy(oneRay).toFixed(),
@ -30,34 +44,10 @@ export const stablecoinStrategyCentralized: IReserveParams = {
reserveDecimals: '6',
};
export const stablecoinStrategyBase: IReserveParams = {
baseVariableBorrowRate: new BigNumber(0.01).multipliedBy(oneRay).toFixed(),
variableRateSlope1: new BigNumber(0.07).multipliedBy(oneRay).toFixed(),
variableRateSlope2: new BigNumber(1.5).multipliedBy(oneRay).toFixed(),
stableRateSlope1: new BigNumber(0.06).multipliedBy(oneRay).toFixed(),
stableRateSlope2: new BigNumber(1.5).multipliedBy(oneRay).toFixed(),
baseLTVAsCollateral: '7500',
liquidationThreshold: '8000',
liquidationBonus: '10500',
borrowingEnabled: true,
stableBorrowRateEnabled: true,
reserveDecimals: '18',
};
export const stablecoinStrategyDAI: IReserveParams = {
...stablecoinStrategyBase,
};
export const stablecoinStrategyTUSD: IReserveParams = {
...stablecoinStrategyCentralized,
baseVariableBorrowRate: new BigNumber(0.01).multipliedBy(oneRay).toFixed(),
variableRateSlope1: new BigNumber(0.04).multipliedBy(oneRay).toFixed(),
variableRateSlope2: new BigNumber(1.5).multipliedBy(oneRay).toFixed(),
stableRateSlope1: new BigNumber(0.14).multipliedBy(oneRay).toFixed(),
stableRateSlope2: new BigNumber(0.6).multipliedBy(oneRay).toFixed(),
borrowingEnabled: true,
stableBorrowRateEnabled: false,
reserveDecimals: '18',
export const strategyGovernanceTokens: IReserveParams = {
...strategyBase,
baseLTVAsCollateral: '4000',
liquidationBonus: '11500',
};
export const stablecoinStrategyBUSD: IReserveParams = {
@ -73,20 +63,65 @@ export const stablecoinStrategyBUSD: IReserveParams = {
stableRateSlope1: new BigNumber(0.14).multipliedBy(oneRay).toFixed(),
stableRateSlope2: new BigNumber(0.6).multipliedBy(oneRay).toFixed(),
};
export const stablecoinStrategyUSDC: IReserveParams = {
...stablecoinStrategyBase,
variableRateSlope2: new BigNumber(0.6).multipliedBy(oneRay).toFixed(),
reserveDecimals: '6',
export const strategyAAVE: IReserveParams = {
...strategyBase,
baseLTVAsCollateral: '5000',
liquidationThreshold: '6500',
liquidationBonus: '11000',
borrowingEnabled: false,
stableBorrowRateEnabled: false,
reserveDecimals: '18',
};
export const stablecoinStrategyUSDT: IReserveParams = {
export const stablecoinStrategyDAI: IReserveParams = {
...stablecoinStrategyBase,
baseLTVAsCollateral: '-1',
};
export const strategyENJ: IReserveParams = {
...strategyBase,
baseLTVAsCollateral: '5500',
stableBorrowRateEnabled: false,
};
export const strategyKNC: IReserveParams = {
...strategyBase,
variableRateSlope1: new BigNumber(0.08).multipliedBy(oneRay).toFixed(),
};
export const strategyLINK: IReserveParams = {
...strategyBase,
baseLTVAsCollateral: '6500',
liquidationThreshold: '7000',
liquidationBonus: '0',
};
export const strategyMANA: IReserveParams = {
...strategyBase,
variableRateSlope1: new BigNumber(0.08).multipliedBy(oneRay).toFixed(),
variableRateSlope2: new BigNumber(0.5).multipliedBy(oneRay).toFixed(),
stableRateSlope2: new BigNumber(0.6).multipliedBy(oneRay).toFixed(),
};
export const strategyMKR: IReserveParams = {
...strategyBase,
baseLTVAsCollateral: '3500',
};
export const strategyREN: IReserveParams = {
...strategyBase,
baseLTVAsCollateral: '5000',
liquidationThreshold: '6500',
liquidationBonus: '11000',
borrowingEnabled: true,
stableBorrowRateEnabled: false,
};
export const strategyREP: IReserveParams = {
...strategyBase,
baseLTVAsCollateral: '3500',
variableRateSlope1: new BigNumber(0.07).multipliedBy(oneRay).toFixed(),
variableRateSlope2: new BigNumber(3).multipliedBy(oneRay).toFixed(),
borrowingEnabled: false,
stableBorrowRateEnabled: true,
reserveDecimals: '6',
};
export const stablecoinStrategySUSD: IReserveParams = {
@ -103,34 +138,47 @@ export const stablecoinStrategySUSD: IReserveParams = {
reserveDecimals: '18',
};
export const strategyAAVE: IReserveParams = {
export const strategySNX: IReserveParams = {
...strategyBase,
baseLTVAsCollateral: '5000',
liquidationThreshold: '6500',
liquidationBonus: '11000',
borrowingEnabled: false,
baseLTVAsCollateral: '1500',
liquidationThreshold: '4000',
baseVariableBorrowRate: new BigNumber(0.03).multipliedBy(oneRay).toFixed(),
variableRateSlope1: new BigNumber(0.12).multipliedBy(oneRay).toFixed(),
variableRateSlope2: new BigNumber(1).multipliedBy(oneRay).toFixed(),
stableBorrowRateEnabled: false,
};
export const stablecoinStrategyTUSD: IReserveParams = {
...stablecoinStrategyCentralized,
baseVariableBorrowRate: new BigNumber(0.01).multipliedBy(oneRay).toFixed(),
variableRateSlope1: new BigNumber(0.04).multipliedBy(oneRay).toFixed(),
variableRateSlope2: new BigNumber(1.5).multipliedBy(oneRay).toFixed(),
stableRateSlope1: new BigNumber(0.14).multipliedBy(oneRay).toFixed(),
stableRateSlope2: new BigNumber(0.6).multipliedBy(oneRay).toFixed(),
borrowingEnabled: true,
stableBorrowRateEnabled: false,
reserveDecimals: '18',
};
export const strategyWETH: IReserveParams = {
baseVariableBorrowRate: new BigNumber(0).multipliedBy(oneRay).toFixed(),
variableRateSlope1: new BigNumber(0.08).multipliedBy(oneRay).toFixed(),
variableRateSlope2: new BigNumber(1).multipliedBy(oneRay).toFixed(),
stableRateSlope1: new BigNumber(0.1).multipliedBy(oneRay).toFixed(),
stableRateSlope2: new BigNumber(1).multipliedBy(oneRay).toFixed(),
baseLTVAsCollateral: '7500',
liquidationThreshold: '8000',
liquidationBonus: '10500',
borrowingEnabled: true,
stableBorrowRateEnabled: true,
reserveDecimals: '18',
export const strategyUNI: IReserveParams = {
...strategyGovernanceTokens,
stableBorrowRateEnabled: false,
};
export const strategyLINK: IReserveParams = {
...strategyBase,
baseLTVAsCollateral: '6500',
export const stablecoinStrategyUSDC: IReserveParams = {
...stablecoinStrategyBase,
variableRateSlope2: new BigNumber(0.6).multipliedBy(oneRay).toFixed(),
reserveDecimals: '6',
};
export const stablecoinStrategyUSDT: IReserveParams = {
...stablecoinStrategyBase,
baseLTVAsCollateral: '-1',
liquidationThreshold: '7000',
liquidationBonus: '0',
borrowingEnabled: false,
stableBorrowRateEnabled: true,
reserveDecimals: '6',
};
export const strategyWBTC: IReserveParams = {
@ -147,66 +195,20 @@ export const strategyWBTC: IReserveParams = {
reserveDecimals: '8',
};
export const strategyKNC: IReserveParams = {
...strategyBase,
export const strategyWETH: IReserveParams = {
baseVariableBorrowRate: new BigNumber(0).multipliedBy(oneRay).toFixed(),
variableRateSlope1: new BigNumber(0.08).multipliedBy(oneRay).toFixed(),
};
export const strategyREP: IReserveParams = {
...strategyBase,
baseLTVAsCollateral: '3500',
variableRateSlope1: new BigNumber(0.07).multipliedBy(oneRay).toFixed(),
variableRateSlope2: new BigNumber(3).multipliedBy(oneRay).toFixed(),
borrowingEnabled: false,
};
export const strategyMKR: IReserveParams = {
...strategyBase,
baseLTVAsCollateral: '3500',
};
export const strategyMANA: IReserveParams = {
...strategyBase,
variableRateSlope1: new BigNumber(0.08).multipliedBy(oneRay).toFixed(),
variableRateSlope2: new BigNumber(0.5).multipliedBy(oneRay).toFixed(),
stableRateSlope2: new BigNumber(0.6).multipliedBy(oneRay).toFixed(),
};
export const strategySNX: IReserveParams = {
...strategyBase,
baseLTVAsCollateral: '1500',
liquidationThreshold: '4000',
baseVariableBorrowRate: new BigNumber(0.03).multipliedBy(oneRay).toFixed(),
variableRateSlope1: new BigNumber(0.12).multipliedBy(oneRay).toFixed(),
variableRateSlope2: new BigNumber(1).multipliedBy(oneRay).toFixed(),
stableBorrowRateEnabled: false,
};
export const strategyENJ: IReserveParams = {
...strategyBase,
baseLTVAsCollateral: '5500',
stableBorrowRateEnabled: false,
};
export const strategyREN: IReserveParams = {
...strategyBase,
baseLTVAsCollateral: '5000',
liquidationThreshold: '6500',
liquidationBonus: '11000',
stableRateSlope1: new BigNumber(0.1).multipliedBy(oneRay).toFixed(),
stableRateSlope2: new BigNumber(1).multipliedBy(oneRay).toFixed(),
baseLTVAsCollateral: '7500',
liquidationThreshold: '8000',
liquidationBonus: '10500',
borrowingEnabled: true,
stableBorrowRateEnabled: false,
stableBorrowRateEnabled: true,
reserveDecimals: '18',
};
export const strategyGovernanceTokens: IReserveParams = {
...strategyBase,
baseLTVAsCollateral: '4000',
liquidationBonus: '11500',
};
export const strategyYFI: IReserveParams = {
...strategyGovernanceTokens,
};
export const strategyUNI: IReserveParams = {
...strategyGovernanceTokens,
stableBorrowRateEnabled: false,
};

View File

@ -13,19 +13,6 @@ export const UniswapConfig: IUniswapConfiguration = {
ConfigName: 'Uniswap',
ProviderId: 2,
ReservesConfig: {
WETH: {
baseVariableBorrowRate: new BigNumber(0).multipliedBy(oneRay).toFixed(),
variableRateSlope1: new BigNumber(0.08).multipliedBy(oneRay).toFixed(),
variableRateSlope2: new BigNumber(0.5).multipliedBy(oneRay).toFixed(),
stableRateSlope1: new BigNumber(0.1).multipliedBy(oneRay).toFixed(),
stableRateSlope2: new BigNumber(0.6).multipliedBy(oneRay).toFixed(),
baseLTVAsCollateral: '-1',
liquidationThreshold: '8000',
liquidationBonus: '10500',
borrowingEnabled: true,
stableBorrowRateEnabled: false,
reserveDecimals: '18',
},
DAI: {
baseVariableBorrowRate: new BigNumber(0.01).multipliedBy(oneRay).toFixed(),
variableRateSlope1: new BigNumber(0.07).multipliedBy(oneRay).toFixed(),
@ -65,6 +52,19 @@ export const UniswapConfig: IUniswapConfiguration = {
stableBorrowRateEnabled: false,
reserveDecimals: '6',
},
WETH: {
baseVariableBorrowRate: new BigNumber(0).multipliedBy(oneRay).toFixed(),
variableRateSlope1: new BigNumber(0.08).multipliedBy(oneRay).toFixed(),
variableRateSlope2: new BigNumber(0.5).multipliedBy(oneRay).toFixed(),
stableRateSlope1: new BigNumber(0.1).multipliedBy(oneRay).toFixed(),
stableRateSlope2: new BigNumber(0.6).multipliedBy(oneRay).toFixed(),
baseLTVAsCollateral: '-1',
liquidationThreshold: '8000',
liquidationBonus: '10500',
borrowingEnabled: true,
stableBorrowRateEnabled: false,
reserveDecimals: '18',
},
UNI_DAI_ETH: {
baseVariableBorrowRate: new BigNumber(0.01).multipliedBy(oneRay).toFixed(),
variableRateSlope1: new BigNumber(0.04).multipliedBy(oneRay).toFixed(),
@ -78,32 +78,6 @@ export const UniswapConfig: IUniswapConfiguration = {
stableBorrowRateEnabled: false,
reserveDecimals: '18',
},
UNI_USDC_ETH: {
baseVariableBorrowRate: new BigNumber(0.01).multipliedBy(oneRay).toFixed(),
variableRateSlope1: new BigNumber(0.04).multipliedBy(oneRay).toFixed(),
variableRateSlope2: new BigNumber(0.5).multipliedBy(oneRay).toFixed(),
stableRateSlope1: new BigNumber(0.16).multipliedBy(oneRay).toFixed(),
stableRateSlope2: new BigNumber(0.6).multipliedBy(oneRay).toFixed(),
baseLTVAsCollateral: '6800',
liquidationThreshold: '7300',
liquidationBonus: '11000',
borrowingEnabled: false,
stableBorrowRateEnabled: false,
reserveDecimals: '18',
},
UNI_SETH_ETH: {
baseVariableBorrowRate: new BigNumber(0.01).multipliedBy(oneRay).toFixed(),
variableRateSlope1: new BigNumber(0.04).multipliedBy(oneRay).toFixed(),
variableRateSlope2: new BigNumber(0.5).multipliedBy(oneRay).toFixed(),
stableRateSlope1: new BigNumber(0.16).multipliedBy(oneRay).toFixed(),
stableRateSlope2: new BigNumber(0.6).multipliedBy(oneRay).toFixed(),
baseLTVAsCollateral: '4800',
liquidationThreshold: '6600',
liquidationBonus: '11000',
borrowingEnabled: false,
stableBorrowRateEnabled: false,
reserveDecimals: '18',
},
UNI_LEND_ETH: {
baseVariableBorrowRate: new BigNumber(0.01).multipliedBy(oneRay).toFixed(),
variableRateSlope1: new BigNumber(0.04).multipliedBy(oneRay).toFixed(),
@ -143,6 +117,32 @@ export const UniswapConfig: IUniswapConfiguration = {
stableBorrowRateEnabled: false,
reserveDecimals: '18',
},
UNI_SETH_ETH: {
baseVariableBorrowRate: new BigNumber(0.01).multipliedBy(oneRay).toFixed(),
variableRateSlope1: new BigNumber(0.04).multipliedBy(oneRay).toFixed(),
variableRateSlope2: new BigNumber(0.5).multipliedBy(oneRay).toFixed(),
stableRateSlope1: new BigNumber(0.16).multipliedBy(oneRay).toFixed(),
stableRateSlope2: new BigNumber(0.6).multipliedBy(oneRay).toFixed(),
baseLTVAsCollateral: '4800',
liquidationThreshold: '6600',
liquidationBonus: '11000',
borrowingEnabled: false,
stableBorrowRateEnabled: false,
reserveDecimals: '18',
},
UNI_USDC_ETH: {
baseVariableBorrowRate: new BigNumber(0.01).multipliedBy(oneRay).toFixed(),
variableRateSlope1: new BigNumber(0.04).multipliedBy(oneRay).toFixed(),
variableRateSlope2: new BigNumber(0.5).multipliedBy(oneRay).toFixed(),
stableRateSlope1: new BigNumber(0.16).multipliedBy(oneRay).toFixed(),
stableRateSlope2: new BigNumber(0.6).multipliedBy(oneRay).toFixed(),
baseLTVAsCollateral: '6800',
liquidationThreshold: '7300',
liquidationBonus: '11000',
borrowingEnabled: false,
stableBorrowRateEnabled: false,
reserveDecimals: '18',
},
},
ChainlinkAggregator: {
[eEthereumNetwork.buidlerevm]: {},
@ -153,33 +153,33 @@ export const UniswapConfig: IUniswapConfiguration = {
USDC: '0x672c1C0d1130912D83664011E7960a42E8cA05D5',
USDT: '0xCC833A6522721B3252e7578c5BCAF65738B75Fc3',
UNI_DAI_ETH: '0x0338C40020Bf886c11406115fD1ba205Ef1D9Ff9',
UNI_USDC_ETH: '0x7f5E5D34591e9a70D187BBA94260C30B92aC0961',
UNI_SETH_ETH: '0xc5F1eA001c1570783b3af418fa775237Eb129EDC',
UNI_LEND_ETH: '0xB996b1a11BA0aACc4deA57f7f92d1722428f2E90',
UNI_LINK_ETH: '0x267490eE9Ad21dfE839aE73A8B1c8C9A36F60d33',
UNI_MKR_ETH: '0x6eBF25AB0A18B8F6243619f1AE6b94373169A069',
UNI_SETH_ETH: '0xc5F1eA001c1570783b3af418fa775237Eb129EDC',
UNI_USDC_ETH: '0x7f5E5D34591e9a70D187BBA94260C30B92aC0961',
},
[EthereumNetwork.ropsten]: {
DAI: '0x64b8e49baded7bfb2fd5a9235b2440c0ee02971b',
USDC: '0xe1480303dde539e2c241bdc527649f37c9cbef7d',
USDT: '0xc08fe0c4d97ccda6b40649c6da621761b628c288',
UNI_DAI_ETH: '0x16048819e3f77b7112eB033624A0bA9d33743028',
UNI_USDC_ETH: '0x6952A2678D574073DB97963886c2F38CD09C8Ba3',
UNI_SETH_ETH: '0x23Ee5188806BD2D31103368B0EA0259bc6706Af1',
UNI_LEND_ETH: '0x43c44B27376Afedee06Bae2A003e979FC3B3Da6C',
UNI_LINK_ETH: '0xb60c29714146EA3539261f599Eb30f62904108Fa',
UNI_MKR_ETH: '0x594ae5421f378b8B4AF9e758C461d2A1FF990BC5',
UNI_SETH_ETH: '0x23Ee5188806BD2D31103368B0EA0259bc6706Af1',
UNI_USDC_ETH: '0x6952A2678D574073DB97963886c2F38CD09C8Ba3',
},
[EthereumNetwork.main]: {
DAI: '0x037E8F2125bF532F3e228991e051c8A7253B642c',
USDC: '0xdE54467873c3BCAA76421061036053e371721708',
USDT: '0xa874fe207DF445ff19E7482C746C4D3fD0CB9AcE',
UNI_DAI_ETH: '0x1bAB293850289Bf161C5DA79ff3d1F02A950555b',
UNI_USDC_ETH: '0x444315Ee92F2bb3579293C17B07194227fA99bF0',
UNI_SETH_ETH: '0x517D40E49660c7705b2e99eEFA6d7B0E9Ba5BF10',
UNI_LEND_ETH: '0xF4C8Db2d999b024bBB6c6022566503eD41f2AC1E',
UNI_LINK_ETH: '0xE2A639Beb647d7F709ca805ABa760bBEfdbE37e3',
UNI_MKR_ETH: '0xEe40a5E8F3732bE6ECDb5A90e23D0b7bF0D4a73c',
UNI_SETH_ETH: '0x517D40E49660c7705b2e99eEFA6d7B0E9Ba5BF10',
UNI_USDC_ETH: '0x444315Ee92F2bb3579293C17B07194227fA99bF0',
},
},
ReserveAssets: {
@ -187,40 +187,40 @@ export const UniswapConfig: IUniswapConfiguration = {
[eEthereumNetwork.buidlerevm]: {},
[eEthereumNetwork.coverage]: {},
[EthereumNetwork.kovan]: {
WETH: '0xd0a1e359811322d97991e03f863a0c30c2cf029c',
DAI: '0xFf795577d9AC8bD7D90Ee22b6C1703490b6512FD',
USDC: '0xe22da380ee6B445bb8273C81944ADEB6E8450422',
USDT: '0x13512979ADE267AB5100878E2e0f485B568328a4',
WETH: '0xd0a1e359811322d97991e03f863a0c30c2cf029c',
UNI_DAI_ETH: '0x2e0086b5343101203ADeE40160ca1BD91E29fF75',
UNI_USDC_ETH: '0x34eA1aB2a43ee696914fc3C0d3e517fA666B9e8D',
UNI_SETH_ETH: '0xCF457d8Bb8D8f54Af1ea1B3710231e89bd6CFbfe',
UNI_LEND_ETH: '0x7615cd666F867406C64E558B9CCC3883e7EC9BA8',
UNI_LINK_ETH: '0xFb9AAc184e79025f936E9C4EF3047Ad4889Df4a8',
UNI_MKR_ETH: '0xB31a1c30f38cD68e8177566Ef950d7bc3C81DaCF',
UNI_SETH_ETH: '0xCF457d8Bb8D8f54Af1ea1B3710231e89bd6CFbfe',
UNI_USDC_ETH: '0x34eA1aB2a43ee696914fc3C0d3e517fA666B9e8D',
},
[EthereumNetwork.ropsten]: {
WETH: '0xc778417e063141139fce010982780140aa0cd5ab',
DAI: '0xf80A32A835F79D7787E8a8ee5721D0fEaFd78108',
USDC: '0x851dEf71f0e6A903375C1e536Bd9ff1684BAD802',
USDT: '0xB404c51BBC10dcBE948077F18a4B8E553D160084',
WETH: '0xc778417e063141139fce010982780140aa0cd5ab',
UNI_DAI_ETH: '0xC245A7d35E652Cae438A1FdB13E474DF53DBB81D',
UNI_USDC_ETH: '0x2BD65323955D08eb600074291305881d1295c4D2',
UNI_SETH_ETH: '0xed4597DCd234867d7A260AD24bAb8253F64940a5',
UNI_LEND_ETH: '0xcD5DE1EDD40aBBD6efE2C306276FF56f81Bc3151',
UNI_LINK_ETH: '0x8dcf3c8d4d69ca7C188c0A4cf219A1dcE1e510d7',
UNI_MKR_ETH: '0xd8b7B99a9205FD0D0abFB6D7a2c13Db2681bff43',
UNI_SETH_ETH: '0xed4597DCd234867d7A260AD24bAb8253F64940a5',
UNI_USDC_ETH: '0x2BD65323955D08eb600074291305881d1295c4D2',
},
[EthereumNetwork.main]: {
WETH: '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2',
DAI: '0x6b175474e89094c44da98b954eedeac495271d0f',
USDC: '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48',
USDT: '0xdac17f958d2ee523a2206206994597c13d831ec7',
WETH: '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2',
UNI_DAI_ETH: '0x2a1530c4c41db0b0b2bb646cb5eb1a67b7158667',
UNI_USDC_ETH: '0x97dec872013f6b5fb443861090ad931542878126',
UNI_SETH_ETH: '0xe9cf7887b93150d4f2da7dfc6d502b216438f244',
UNI_LEND_ETH: '0xcaa7e4656f6a2b59f5f99c745f91ab26d1210dce',
UNI_LINK_ETH: '0xf173214c720f58e03e194085b1db28b50acdeead',
UNI_MKR_ETH: '0x2c4bd064b998838076fa341a83d007fc2fa50957',
UNI_SETH_ETH: '0xe9cf7887b93150d4f2da7dfc6d502b216438f244',
UNI_USDC_ETH: '0x97dec872013f6b5fb443861090ad931542878126',
},
},
};

View File

@ -28,24 +28,30 @@ contract LendingPoolAddressesProvider is Ownable, ILendingPoolAddressesProvider
bytes32 private constant LENDING_RATE_ORACLE = 'LENDING_RATE_ORACLE';
/**
* @dev Sets an address for an id, allowing to cover it or not with a proxy
* @dev Sets an address for an id by updating a proxy implementation
* @param id The id
* @param newAddress The address to set, pass address(0) if a proxy is needed
* @param implementationAddress The address of the implementation if we want it covered by a proxy
* address(0) if we don't want a proxy covering
*/
function setAddress(
function setAddressAsProxy(
bytes32 id,
address newAddress,
address implementationAddress
) external override onlyOwner {
if (implementationAddress != address(0)) {
_updateImpl(id, implementationAddress);
emit AddressSet(id, implementationAddress, true);
} else {
_addresses[id] = newAddress;
emit AddressSet(id, newAddress, false);
}
_updateImpl(id, implementationAddress);
emit AddressSet(id, implementationAddress, true);
}
/**
* @dev Sets an address for an id replacing the address saved in the addresses map
* @param id The id
* @param newAddress The address to set, pass address(0) if a proxy is needed
*/
function setAddress(
bytes32 id,
address newAddress
) external override onlyOwner {
_addresses[id] = newAddress;
emit AddressSet(id, newAddress, false);
}
/**

View File

@ -36,7 +36,6 @@ contract ATokensAndRatesHelper is Ownable {
) external onlyOwner {
require(tokens.length == symbols.length, 't Arrays not same length');
require(rates.length == symbols.length, 'r Arrays not same length');
for (uint256 i = 0; i < tokens.length; i++) {
emit deployedContracts(
address(

View File

@ -20,7 +20,11 @@ interface ILendingPoolAddressesProvider {
function setAddress(
bytes32 id,
address newAddress,
address newAddress
) external;
function setAddressAsProxy(
bytes32 id,
address impl
) external;

View File

@ -389,6 +389,7 @@ contract LendingPool is VersionedInitializable, ILendingPool, LendingPoolStorage
ValidationLogic.validateSetUseReserveAsCollateral(
reserve,
asset,
useAsCollateral,
_reserves,
_usersConfig[msg.sender],
_reservesList,

View File

@ -554,21 +554,6 @@ contract LendingPoolConfigurator is VersionedInitializable {
emit ReserveLiquidationBonusChanged(asset, bonus);
}
/**
* @dev updates the reserve decimals
* @param asset the address of the reserve
* @param decimals the new number of decimals
**/
function setReserveDecimals(address asset, uint256 decimals) external onlyPoolAdmin {
ReserveConfiguration.Map memory currentConfig = pool.getConfiguration(asset);
currentConfig.setDecimals(decimals);
pool.setConfiguration(asset, currentConfig.data);
emit ReserveDecimalsChanged(asset, decimals);
}
/**
* @dev sets the interest rate strategy of a reserve
* @param asset the address of the reserve

View File

@ -22,7 +22,7 @@ library Errors {
string public constant BORROW_ALLOWANCE_NOT_ENOUGH = '59'; // User borrows on behalf, but allowance are too small
//contract specific errors
string public constant VL_AMOUNT_NOT_GREATER_THAN_0 = '1'; // 'Amount must be greater than 0'
string public constant VL_INVALID_AMOUNT = '1'; // 'Amount must be greater than 0'
string public constant VL_NO_ACTIVE_RESERVE = '2'; // 'Action requires an active reserve'
string public constant VL_RESERVE_FROZEN = '3'; // 'Action cannot be performed because the reserve is frozen'
string public constant VL_CURRENT_AVAILABLE_LIQUIDITY_NOT_ENOUGH = '4'; // 'The current liquidity is not enough'

View File

@ -36,7 +36,7 @@ library ValidationLogic {
function validateDeposit(ReserveLogic.ReserveData storage reserve, uint256 amount) external view {
(bool isActive, bool isFrozen, , ) = reserve.configuration.getFlags();
require(amount > 0, Errors.VL_AMOUNT_NOT_GREATER_THAN_0);
require(amount != 0, Errors.VL_INVALID_AMOUNT);
require(isActive, Errors.VL_NO_ACTIVE_RESERVE);
require(!isFrozen, Errors.VL_RESERVE_FROZEN);
}
@ -62,7 +62,7 @@ library ValidationLogic {
uint256 reservesCount,
address oracle
) external view {
require(amount > 0, Errors.VL_AMOUNT_NOT_GREATER_THAN_0);
require(amount != 0, Errors.VL_INVALID_AMOUNT);
require(amount <= userBalance, Errors.VL_NOT_ENOUGH_AVAILABLE_USER_BALANCE);
@ -139,6 +139,7 @@ library ValidationLogic {
require(vars.isActive, Errors.VL_NO_ACTIVE_RESERVE);
require(!vars.isFrozen, Errors.VL_RESERVE_FROZEN);
require(amount != 0, Errors.VL_INVALID_AMOUNT);
require(vars.borrowingEnabled, Errors.VL_BORROWING_NOT_ENABLED);
@ -232,7 +233,7 @@ library ValidationLogic {
require(isActive, Errors.VL_NO_ACTIVE_RESERVE);
require(amountSent > 0, Errors.VL_AMOUNT_NOT_GREATER_THAN_0);
require(amountSent > 0, Errors.VL_INVALID_AMOUNT);
require(
(stableDebt > 0 &&
@ -304,6 +305,7 @@ library ValidationLogic {
function validateSetUseReserveAsCollateral(
ReserveLogic.ReserveData storage reserve,
address reserveAddress,
bool useAsCollateral,
mapping(address => ReserveLogic.ReserveData) storage reservesData,
UserConfiguration.Map storage userConfig,
mapping(uint256 => address) storage reserves,
@ -315,6 +317,7 @@ library ValidationLogic {
require(underlyingBalance > 0, Errors.VL_UNDERLYING_BALANCE_NOT_GREATER_THAN_0);
require(
useAsCollateral ||
GenericLogic.balanceDecreaseAllowed(
reserveAddress,
msg.sender,

View File

@ -11,7 +11,7 @@ import {UserConfiguration} from '../libraries/configuration/UserConfiguration.so
import {IStableDebtToken} from '../tokenization/interfaces/IStableDebtToken.sol';
import {IVariableDebtToken} from '../tokenization/interfaces/IVariableDebtToken.sol';
contract AaveProtocolTestHelpers {
contract AaveProtocolDataProvider {
using ReserveConfiguration for ReserveConfiguration.Map;
using UserConfiguration for UserConfiguration.Map;

View File

@ -107,7 +107,7 @@ contract WalletBalanceProvider {
}
balances[j] = balanceOf(user, reservesWithEth[j]);
}
balances[reservesWithEth.length] = balanceOf(user, MOCK_ETH_ADDRESS);
balances[reserves.length] = balanceOf(user, MOCK_ETH_ADDRESS);
return (reservesWithEth, balances);
}

View File

@ -5449,7 +5449,7 @@
}
}
},
"contracts/misc/AaveProtocolTestHelpers.sol": {
"contracts/misc/AaveProtocolDataProvider.sol": {
"l": {
"18": 3,
"22": 1,
@ -5466,7 +5466,7 @@
"42": 34,
"47": 2
},
"path": "/src/contracts/misc/AaveProtocolTestHelpers.sol",
"path": "/src/contracts/misc/AaveProtocolDataProvider.sol",
"s": {
"1": 3,
"2": 1,

View File

@ -251,7 +251,7 @@
"deployer": "0xc783df8a850f42e7F7e57013759C285caa701eB6"
},
"kovan": {
"address": "0x688C81eC2A0Be6F287fD8C9c343D299c03A34804",
"address": "0xfD65F43f039832D703fAb8B635C7522d4966f118",
"deployer": "0x85e4A467343c0dc4aDAB74Af84448D9c45D8ae6F"
},
"hardhat": {
@ -265,11 +265,11 @@
"deployer": "0xc783df8a850f42e7F7e57013759C285caa701eB6"
},
"kovan": {
"address": "0xf189cC1eD07cEFB6e61082104e12673E133163f5",
"address": "0x082dAEDD5Ff6F6Ae58FF83Be57A3F76fC5Feff41",
"deployer": "0x85e4A467343c0dc4aDAB74Af84448D9c45D8ae6F"
},
"hardhat": {
"address": "0x8456161947DFc1fC159A0B26c025cD2b4bba0c3e",
"address": "0x12080583C4F0211eC382d33a273E6D0f9fAb0F75",
"deployer": "0xc783df8a850f42e7F7e57013759C285caa701eB6"
}
},
@ -279,11 +279,11 @@
"deployer": "0xc783df8a850f42e7F7e57013759C285caa701eB6"
},
"kovan": {
"address": "0x757855037B01c45832f8d662D217C766Ba4e8e74",
"address": "0x0ed5565EdDE0cea739c30BD5b56AAaa49611929E",
"deployer": "0x85e4A467343c0dc4aDAB74Af84448D9c45D8ae6F"
},
"hardhat": {
"address": "0x5F6CaC05CDF893f029b29F44d368eAeD40e573B6",
"address": "0x2cBbbBE1B75Ad7848F0844215816F551f429c64f",
"deployer": "0xc783df8a850f42e7F7e57013759C285caa701eB6"
}
},
@ -293,11 +293,11 @@
"deployer": "0xc783df8a850f42e7F7e57013759C285caa701eB6"
},
"kovan": {
"address": "0xBc013D1412E0F4acacAa64CDc1c93e8A3Ecd8fF4",
"address": "0x571270764042E5932C08066e8Da692f05A31153A",
"deployer": "0x85e4A467343c0dc4aDAB74Af84448D9c45D8ae6F"
},
"hardhat": {
"address": "0x92cfBAB5A86631e9F1A6126b42E01A74eadA61Df",
"address": "0xbAc762e2000b6815268587b081Fd17aC25519aD5",
"deployer": "0xc783df8a850f42e7F7e57013759C285caa701eB6"
}
},
@ -307,11 +307,11 @@
"deployer": "0xc783df8a850f42e7F7e57013759C285caa701eB6"
},
"kovan": {
"address": "0xba681EfB276237903df60ef92D564610A393Dbd6",
"address": "0xdb3d5013b9f51063D2d934AD717C8e7Ef90A6f19",
"deployer": "0x85e4A467343c0dc4aDAB74Af84448D9c45D8ae6F"
},
"hardhat": {
"address": "0x78Aeff0658Fa67735fBF99Ce7CDB01Fe5D520259",
"address": "0xa43Ba00FCA75B805D17f67F9433b971E9a398690",
"deployer": "0xc783df8a850f42e7F7e57013759C285caa701eB6"
}
},
@ -321,10 +321,11 @@
"deployer": "0xc783df8a850f42e7F7e57013759C285caa701eB6"
},
"kovan": {
"address": "0x59525b17808F0a7eFe62303ca46e596A5a602683"
"address": "0x3F3BA806D66a5F3B03c7f30e94023A74eacE1c8F"
},
"hardhat": {
"address": "0x813F07B2100e59ba6555d0D6dBA2660c68514665"
"address": "0xAa7BC1924711B77A0F3Aaebdd550BfeDDDbaf3cd",
"deployer": "0xc783df8a850f42e7F7e57013759C285caa701eB6"
}
},
"LendingPoolConfigurator": {
@ -332,7 +333,7 @@
"address": "0xdbaA15927b1463EdD14Cf51D082BD7703Fd1C238"
},
"kovan": {
"address": "0x0a9bc0ce44e6473a1B0e30b54b7227de6E75Fd83"
"address": "0x2bc505Db38aEA5EfA42e07Fb3855875094E2eB44"
},
"hardhat": {
"address": "0xdbaA15927b1463EdD14Cf51D082BD7703Fd1C238"
@ -344,11 +345,11 @@
"deployer": "0xc783df8a850f42e7F7e57013759C285caa701eB6"
},
"kovan": {
"address": "0x882AD7981FE3d63200A23F5d009A1d0488b5ea7e",
"address": "0xA103ea2B53e53209a4b58E4F2b4cd21958C9e3AA",
"deployer": "0x85e4A467343c0dc4aDAB74Af84448D9c45D8ae6F"
},
"hardhat": {
"address": "0xE4C10Db67595aF2Cb4166c8C274e0140f7E43059",
"address": "0x099d9fF8F818290C8b5B7Db5bFca84CEebd2714c",
"deployer": "0xc783df8a850f42e7F7e57013759C285caa701eB6"
}
},
@ -358,11 +359,11 @@
"deployer": "0xc783df8a850f42e7F7e57013759C285caa701eB6"
},
"kovan": {
"address": "0x20Bfad73e3A8aA9161b5c553f7825002a175DB23",
"address": "0xdbB044C41a395c2db96a401aFCb4367F6546B893",
"deployer": "0x85e4A467343c0dc4aDAB74Af84448D9c45D8ae6F"
},
"hardhat": {
"address": "0x099d9fF8F818290C8b5B7Db5bFca84CEebd2714c",
"address": "0x85bdE212E66e2BAE510E44Ed59116c1eC712795b",
"deployer": "0xc783df8a850f42e7F7e57013759C285caa701eB6"
}
},
@ -372,7 +373,7 @@
"deployer": "0xc783df8a850f42e7F7e57013759C285caa701eB6"
},
"hardhat": {
"address": "0x85bdE212E66e2BAE510E44Ed59116c1eC712795b",
"address": "0xe1B3b8F6b298b52bCd15357ED29e65e66a4045fF",
"deployer": "0xc783df8a850f42e7F7e57013759C285caa701eB6"
}
},
@ -382,7 +383,7 @@
"deployer": "0xc783df8a850f42e7F7e57013759C285caa701eB6"
},
"hardhat": {
"address": "0x8Dd7f10813aC8fCB83ad7ad94e941D53b002fBc7",
"address": "0xfA9dbd706c674801F50169f4B5862cCe045408E6",
"deployer": "0xc783df8a850f42e7F7e57013759C285caa701eB6"
}
},
@ -392,7 +393,7 @@
"deployer": "0xc783df8a850f42e7F7e57013759C285caa701eB6"
},
"hardhat": {
"address": "0xfA9dbd706c674801F50169f4B5862cCe045408E6",
"address": "0xCeEa6148D75268b6E930AE41d7a31baE1CA318d8",
"deployer": "0xc783df8a850f42e7F7e57013759C285caa701eB6"
}
},
@ -402,20 +403,20 @@
"deployer": "0xc783df8a850f42e7F7e57013759C285caa701eB6"
},
"hardhat": {
"address": "0xbFAD7C67855cc0272CC5ED00dAabeFDB31E7190a",
"address": "0x98B40aAC844674B2287556E75b3ef5530DfCfcB7",
"deployer": "0xc783df8a850f42e7F7e57013759C285caa701eB6"
}
},
"AaveProtocolTestHelpers": {
"AaveProtocolDataProvider": {
"buidlerevm": {
"address": "0x93472C0e03215F9c33DA240Eb16703C8244eAa8c"
},
"kovan": {
"address": "0xe875775D75F384944E77086Ea54bAD008ea8004A",
"address": "0x44d78901180FbA093A5495fFE4BcBf922110D241",
"deployer": "0x85e4A467343c0dc4aDAB74Af84448D9c45D8ae6F"
},
"hardhat": {
"address": "0x93472C0e03215F9c33DA240Eb16703C8244eAa8c"
"address": "0x3392c115Ff2CE1A782B4a965fF770da61e69228E"
}
},
"LendingPoolCollateralManager": {
@ -424,11 +425,11 @@
"deployer": "0xc783df8a850f42e7F7e57013759C285caa701eB6"
},
"kovan": {
"address": "0xc072D8A233C8C52239dcD6ab39954240a0699055",
"address": "0x999ce4Ed17B90A1421f1D6b8891D87Ed61cb2763",
"deployer": "0x85e4A467343c0dc4aDAB74Af84448D9c45D8ae6F"
},
"hardhat": {
"address": "0x417fc1038b2AF553D65F4fF2839efE9f93Ec1eac",
"address": "0x8BFFF31B1757da579Bb5B118489568526F7fb6D4",
"deployer": "0xc783df8a850f42e7F7e57013759C285caa701eB6"
}
},
@ -437,7 +438,7 @@
"address": "0x0459c841b02Aee8730730C737582c53B20a27288"
},
"hardhat": {
"address": "0x0459c841b02Aee8730730C737582c53B20a27288"
"address": "0x2530ce07D254eA185E8e0bCC37a39e2FbA3bE548"
}
},
"WalletBalanceProvider": {
@ -446,11 +447,11 @@
"deployer": "0xc783df8a850f42e7F7e57013759C285caa701eB6"
},
"kovan": {
"address": "0xf896A27CDd4E3bC101aCEa86cc1cE6b7C91AEFA1",
"address": "0x06C312C74F047f6009678239ada37BCE7bDC7DDb",
"deployer": "0x85e4A467343c0dc4aDAB74Af84448D9c45D8ae6F"
},
"hardhat": {
"address": "0x2530ce07D254eA185E8e0bCC37a39e2FbA3bE548",
"address": "0x0Cf45557d25a4e4c0F1aC65EF6c48ae67c61a0E6",
"deployer": "0xc783df8a850f42e7F7e57013759C285caa701eB6"
}
},
@ -460,7 +461,7 @@
"deployer": "0xc783df8a850f42e7F7e57013759C285caa701eB6"
},
"hardhat": {
"address": "0x7fAeC7791277Ff512c41CA903c177B2Ed952dDAc",
"address": "0x33958cC3535Fc328369EAC2B2Bebd120D67C7fa1",
"deployer": "0xc783df8a850f42e7F7e57013759C285caa701eB6"
}
},
@ -470,7 +471,7 @@
"deployer": "0xc783df8a850f42e7F7e57013759C285caa701eB6"
},
"hardhat": {
"address": "0x33958cC3535Fc328369EAC2B2Bebd120D67C7fa1",
"address": "0x2cBbbBE1B75Ad7848F0844215816F551f429c64f",
"deployer": "0xc783df8a850f42e7F7e57013759C285caa701eB6"
}
},
@ -480,7 +481,7 @@
"deployer": "0xc783df8a850f42e7F7e57013759C285caa701eB6"
},
"hardhat": {
"address": "0x2cBbbBE1B75Ad7848F0844215816F551f429c64f",
"address": "0xbAc762e2000b6815268587b081Fd17aC25519aD5",
"deployer": "0xc783df8a850f42e7F7e57013759C285caa701eB6"
}
},
@ -489,6 +490,10 @@
"address": "0x0Cf45557d25a4e4c0F1aC65EF6c48ae67c61a0E6",
"deployer": "0xc783df8a850f42e7F7e57013759C285caa701eB6"
},
"kovan": {
"address": "0x132D4cdC59981AE25De7F67b17160d78b462d199",
"deployer": "0x85e4A467343c0dc4aDAB74Af84448D9c45D8ae6F"
},
"hardhat": {
"address": "0x7fAeC7791277Ff512c41CA903c177B2Ed952dDAc",
"deployer": "0xc783df8a850f42e7F7e57013759C285caa701eB6"
@ -500,7 +505,7 @@
"deployer": "0xc783df8a850f42e7F7e57013759C285caa701eB6"
},
"hardhat": {
"address": "0x0Cf45557d25a4e4c0F1aC65EF6c48ae67c61a0E6",
"address": "0xf784709d2317D872237C4bC22f867d1BAe2913AB",
"deployer": "0xc783df8a850f42e7F7e57013759C285caa701eB6"
}
},
@ -510,7 +515,7 @@
"deployer": "0xc783df8a850f42e7F7e57013759C285caa701eB6"
},
"hardhat": {
"address": "0x7fAeC7791277Ff512c41CA903c177B2Ed952dDAc",
"address": "0x33958cC3535Fc328369EAC2B2Bebd120D67C7fa1",
"deployer": "0xc783df8a850f42e7F7e57013759C285caa701eB6"
}
},
@ -560,7 +565,7 @@
"deployer": "0xc783df8a850f42e7F7e57013759C285caa701eB6"
},
"hardhat": {
"address": "0x33958cC3535Fc328369EAC2B2Bebd120D67C7fa1",
"address": "0x2cBbbBE1B75Ad7848F0844215816F551f429c64f",
"deployer": "0xc783df8a850f42e7F7e57013759C285caa701eB6"
}
},
@ -570,7 +575,7 @@
"deployer": "0xc783df8a850f42e7F7e57013759C285caa701eB6"
},
"hardhat": {
"address": "0x33958cC3535Fc328369EAC2B2Bebd120D67C7fa1",
"address": "0x2cBbbBE1B75Ad7848F0844215816F551f429c64f",
"deployer": "0xc783df8a850f42e7F7e57013759C285caa701eB6"
}
},
@ -583,5 +588,701 @@
"address": "0x53369fd4680FfE3DfF39Fc6DDa9CfbfD43daeA2E",
"deployer": "0xc783df8a850f42e7F7e57013759C285caa701eB6"
}
},
"LendingPoolImpl": {
"kovan": {
"address": "0x6152D1d883F4C5dA18B47FE45e6eB2Ee79339E78"
},
"hardhat": {
"address": "0xAa7BC1924711B77A0F3Aaebdd550BfeDDDbaf3cd"
}
},
"LendingPoolConfiguratorImpl": {
"kovan": {
"address": "0x46c410d5636dF430Ff1a7DDff7683d6CfdBF4A09"
},
"hardhat": {
"address": "0x1750499D05Ed1674d822430FB960d5F6731fDf64"
}
},
"LendingPoolCollateralManagerImpl": {
"kovan": {
"address": "0x999ce4Ed17B90A1421f1D6b8891D87Ed61cb2763"
},
"hardhat": {
"address": "0x8BFFF31B1757da579Bb5B118489568526F7fb6D4"
}
},
"stableDebtAAVE": {
"kovan": {
"address": "0xc206d99A916A45bAa74663C38F063C5f16d566bb"
},
"hardhat": {
"address": "0xcFB79d2c986Ca61Dbd288f80108b9e8C4cC6522b"
}
},
"variableDebtAAVE": {
"kovan": {
"address": "0xCBd4194aB034AcD234400F742Bf3093b917aa581"
},
"hardhat": {
"address": "0x1073981e3D3Af966a1137a3460dB881AAED7ae7a"
}
},
"stableDebtBAT": {
"kovan": {
"address": "0x2Af9Ce7274Ca7084abbf0Db313aEFA289D361A12"
},
"hardhat": {
"address": "0x4c90c5Fa9C907F2C993E66446E022260e2AfC8d1"
}
},
"variableDebtBAT": {
"kovan": {
"address": "0x2962aCbeDa9d1A258E1cBb99A6435A3D2F1af5eE"
},
"hardhat": {
"address": "0x86BAB8904c2969DE5EF732F8BC1D805C1aD56ddD"
}
},
"stableDebtBUSD": {
"kovan": {
"address": "0x58704aB618678c58a11e86f1cf7b3ddACB659114"
},
"hardhat": {
"address": "0xa279C092B779bD051DA5333978e30647501AA958"
}
},
"variableDebtBUSD": {
"kovan": {
"address": "0x3903DB7B363A1C0B5272a53cA3B27d9D7759DE53"
},
"hardhat": {
"address": "0xeB24f8Dff752f099AA106207b8f49818ca78D02e"
}
},
"stableDebtDAI": {
"kovan": {
"address": "0xe3CD1bbB9041b8c32D1ec96210842Ee1d91872B4"
},
"hardhat": {
"address": "0x7cc0483c098d4e36f2f0AF72a7B13E40E13cd613"
}
},
"variableDebtDAI": {
"kovan": {
"address": "0x6207fdDba94b932A73f02a988A760BBd4d942152"
},
"hardhat": {
"address": "0x38E82417A3b37f7faA75d2DD6260d5C24f529e1e"
}
},
"aAAVE": {
"kovan": {
"address": "0x84145b267060bf9eE8FCA80324498A7444c8e821"
},
"hardhat": {
"address": "0x6e5d1a9C405DF46a8503893DBa99c3af5Dc1FB5A"
}
},
"strategyAAVE": {
"kovan": {
"address": "0x367356225e3BFA34c1cb447CFCdEE7a2D2dB38B5"
},
"hardhat": {
"address": "0xCDfa18cdFEFCa96D6c79628c6ef941201b63faE4"
}
},
"aBAT": {
"kovan": {
"address": "0x2490F90399e169381DF8c78F81aC635f4be0d8A3"
},
"hardhat": {
"address": "0xCaA841b61FfEf4017209311f2B0B2e2f88eBA3bc"
}
},
"strategyBAT": {
"kovan": {
"address": "0xac86Db376b8255d8FD8e41B092535875471eE311"
},
"hardhat": {
"address": "0x8225B75F6eed9415D3FEABAa5B53628c6c7D29E2"
}
},
"aBUSD": {
"kovan": {
"address": "0x6645315FA490C24e7969439EeF4c143ce69B3035"
},
"hardhat": {
"address": "0x7EebA31C65BCceBF0F2ef6eFf9edf170De96A139"
}
},
"strategyBUSD": {
"kovan": {
"address": "0xf4F7F30a34FDdB1Fd5B166CF121E2786a62B96Aa"
},
"hardhat": {
"address": "0x66D0d53519B4A06f007A2Da43599EB844f6F4a7e"
}
},
"aDAI": {
"kovan": {
"address": "0xb1967F5b6e65705ACF985437f5743a63eDa20F73"
},
"hardhat": {
"address": "0xf72805fA3E8Bd360bCBA4d069FC3B882001bB017"
}
},
"strategyDAI": {
"kovan": {
"address": "0x0ffeB139529D3DA091F8239712D25eab404C4421"
},
"hardhat": {
"address": "0xB79EcFC3ea936e0e904DA3190CD1C8b8cc5F99B5"
}
},
"stableDebtENJ": {
"kovan": {
"address": "0x59FF56F1bE382464468637e59c5Ae57398B143cF"
},
"hardhat": {
"address": "0xFE6c73d2880c7F5D2CDfe495C500AF94fECd09E9"
}
},
"variableDebtENJ": {
"kovan": {
"address": "0xb6DA3a57ea0A5b3C4f1926E9238c6F34b5B61eca"
},
"hardhat": {
"address": "0x1890c00253FbD4130A4191CDA13e443b8708DEAF"
}
},
"stableDebtKNC": {
"kovan": {
"address": "0x813863F06b228DAC48ed2E861a3c07eD10e8D2F0"
},
"hardhat": {
"address": "0xfdAA87AfAF7F617F84480eDc705d8Fd4B78EDEcB"
}
},
"variableDebtKNC": {
"kovan": {
"address": "0x8B08B2678D105Bf32F8F5A2013382773b2b24733"
},
"hardhat": {
"address": "0x8A420528eC19177Deb9f1F0e2965964018f896c7"
}
},
"stableDebtLINK": {
"kovan": {
"address": "0x86A28c4B9Bc2BFc03743b136405B63e6ceB4e963"
},
"hardhat": {
"address": "0x8a8eB2979316f4F173A97ff91E0e1Dd106039ad4"
}
},
"variableDebtLINK": {
"kovan": {
"address": "0x7A68F4382419D86c90cc069EF692BaaCfd3301Da"
},
"hardhat": {
"address": "0xa0207cf18d773Bae5F5d816fc674fF8FFd0D6fE6"
}
},
"stableDebtMANA": {
"kovan": {
"address": "0xb61c3B1BF95B78eCC327ddcd614ba96FEe8127b0"
},
"hardhat": {
"address": "0xE5107B38FFB21AD61185785816559f8B3aA54Ac5"
}
},
"variableDebtMANA": {
"kovan": {
"address": "0x196143A06206c5d47394c114ad5318b85CAC2E88"
},
"hardhat": {
"address": "0x1259DA780FF797C1a11d534b0BaC534eD2b3F109"
}
},
"aENJ": {
"kovan": {
"address": "0xF2F9f31FFB0f8d43974B05Bb560f093b441F5B1b"
},
"hardhat": {
"address": "0xa9DFb142061Ef496F48078d9eA39A2D992236D0f"
}
},
"strategyENJ": {
"kovan": {
"address": "0x66d0B7Ccd0C9a76A831334e9fE8a71680DD0A9e2"
},
"hardhat": {
"address": "0xaaE80234037A18Ee462b1727ed0621b54dFcEDA6"
}
},
"aKNC": {
"kovan": {
"address": "0x5675D816D05cEF2bBF2737EbD55727549D4143e0"
},
"hardhat": {
"address": "0x8076E5d426aa3B5C4c98570b3a9033EE67aFe849"
}
},
"strategyKNC": {
"kovan": {
"address": "0x8C7d058c50b241dD01d6a6d4E2a10C6c78e21eB3"
},
"hardhat": {
"address": "0x87809db6234f27E3AacDEb316c00DbFCA77B11B3"
}
},
"aLINK": {
"kovan": {
"address": "0x729c933284e8226137cd8a5ec39bD20A9c4c49F9"
},
"hardhat": {
"address": "0xe90Ad292698ddaE3Dc305Eb98Ff5FD7341c8a637"
}
},
"strategyLINK": {
"kovan": {
"address": "0xB09a6AB9d32a576e73159083aFE9aBe14c29173E"
},
"hardhat": {
"address": "0x436d1eE2EDa1F7a98f2418709d10465c98Ed3828"
}
},
"aMANA": {
"kovan": {
"address": "0xB98571944af08b8698622Ab0A988c59738Cf2AB8"
},
"hardhat": {
"address": "0x8599378fE42e4FB26Ad214FB1545076EB19b8b0f"
}
},
"strategyMANA": {
"kovan": {
"address": "0xB44Ca018DB828f67C2BaFb6846AF12c5cCb92122"
},
"hardhat": {
"address": "0x487E219628bb5227b2B490CaEE2E2b47ec06D204"
}
},
"stableDebtMKR": {
"kovan": {
"address": "0x536FA5ACA31cA1FE60Ec8a54432bA8E08E86222E"
},
"hardhat": {
"address": "0x3deF3E7577D5Ddf0ea10fB58730fECdA673711C8"
}
},
"variableDebtMKR": {
"kovan": {
"address": "0x6BF5055Fe4312194723888875Ce73A9461510344"
},
"hardhat": {
"address": "0x509B355B5d665a209e888B20B818e53fAdEb47B7"
}
},
"stableDebtREN": {
"kovan": {
"address": "0x2372E7a3d03e18F6ece2FDcb453c03e609134842"
},
"hardhat": {
"address": "0x2A7C4a4D6b7db3beF0e277D950192c421aF4BD69"
}
},
"variableDebtREN": {
"kovan": {
"address": "0x89C3b25C3C4d7f7Fd25B8cCe1De60Af835696C1B"
},
"hardhat": {
"address": "0x5d1B59460fa295F6B4DEB74C74F4D11f4de60517"
}
},
"stableDebtREP": {
"kovan": {
"address": "0x9ED2D2d415A262487D7f0a3Ec62E8467fd3CF278"
},
"hardhat": {
"address": "0x80288A583c216fB0F6a7ccA1Fbc22d7727E2135a"
}
},
"variableDebtREP": {
"kovan": {
"address": "0xe1333768d0209078254215A131d49E3dE36F4617"
},
"hardhat": {
"address": "0xd7E287c1B79c7DA0F6fF7cdEA1026f1223c24F8a"
}
},
"stableDebtSNX": {
"kovan": {
"address": "0xB14dbC77a03703074ed8a95f288413985f996b99"
},
"hardhat": {
"address": "0x0Aa250b8A76d9228Cc7609013cc77c500Ee802E7"
}
},
"variableDebtSNX": {
"kovan": {
"address": "0x77E31F2CDC45921156df5288D4dB20D3A5A915f2"
},
"hardhat": {
"address": "0xf45700a9EAD19BFA6770802E3807E3eE37E8E492"
}
},
"aMKR": {
"kovan": {
"address": "0xd87c0D428f89D54176808A3e78632c90C44fF5a5"
},
"hardhat": {
"address": "0x05EDF38bB3D948E96745f39072d59dCc915194Dd"
}
},
"strategyMKR": {
"kovan": {
"address": "0x349E1B2e94b600Dd09817924207E50A6660fAF2B"
},
"hardhat": {
"address": "0x90D5cff61508785557eaA45DeED1297809F49371"
}
},
"aREN": {
"kovan": {
"address": "0x9410999dFA3527317f0Ae3b5D2A54c213A48f9d1"
},
"hardhat": {
"address": "0xB436Db1757e0c474DaF67666BC35F5fF7062541D"
}
},
"strategyREN": {
"kovan": {
"address": "0x192638591E5Bb456498E380cf91f456Fef21C4b4"
},
"hardhat": {
"address": "0x26eC70DcA80E8dBDaAcBff415aCdcF791C89CEBe"
}
},
"aREP": {
"kovan": {
"address": "0x8C94FE9CE952738C48799326E63294626e1A3C7c"
},
"hardhat": {
"address": "0xfcD974Cec976c536745bBB30e6C7E083a1Ab82EC"
}
},
"strategyREP": {
"kovan": {
"address": "0x1D2F67F9bb6db702067Fbb0D400c864a1ffC5594"
},
"hardhat": {
"address": "0x0E7f0c6Bf3bA63A28e1EFdDb7F3186A24b90566D"
}
},
"aSNX": {
"kovan": {
"address": "0x2473e6Ed1F9cbcc3141eB04AEd432BaAB575fDD1"
},
"hardhat": {
"address": "0x21FA83fB5d14301B53Efc6e44C565C80063d1c50"
}
},
"strategySNX": {
"kovan": {
"address": "0x75cb1cEB23956D20b94fF63ec9dB0990E5920A91"
},
"hardhat": {
"address": "0x5806cCA75C8fEf151881d93E7e81EB103F23fb7b"
}
},
"stableDebtSUSD": {
"kovan": {
"address": "0xD59F6350A3a75cfa09Df8A182BF55be37f8A8840"
},
"hardhat": {
"address": "0xDfD96D3cac8b157176292c547A61eD7586713527"
}
},
"variableDebtSUSD": {
"kovan": {
"address": "0xcd8b423809eb2565f0e0f2d0435dFBAdcBBdCF18"
},
"hardhat": {
"address": "0xcc94Ce18B9a7522d12675cA3fFC1A862Ac0373C1"
}
},
"stableDebtTUSD": {
"kovan": {
"address": "0xA3b22b35DAee9F2E73F2A05eF57799B821513930"
},
"hardhat": {
"address": "0x2C4ec78AD3Ff19F35e0dbF35837490C4f7b4224E"
}
},
"variableDebtTUSD": {
"kovan": {
"address": "0x648663CD12F9BCde674c18a1F04A455e23aFc6b3"
},
"hardhat": {
"address": "0xC9C2c855fA6EAFc5780B661b2CD1c8985c45D720"
}
},
"stableDebtUNI": {
"kovan": {
"address": "0x30E2aBE48E78646347C3Cf8C437AE965AB6e9303"
},
"hardhat": {
"address": "0x1a2f37C5Ed6bEA450Ac31E10ED682994C7C77835"
}
},
"variableDebtUNI": {
"kovan": {
"address": "0x83028921E12c9adB6c7bBa1d6872C9e771bbEC20"
},
"hardhat": {
"address": "0x83D129a2efFa0ba0d5B09f7CdfBEaDE1F847201E"
}
},
"stableDebtUSDC": {
"kovan": {
"address": "0xe86554cd90D2d8BF7fd5F3931F833e7c1604CbCE"
},
"hardhat": {
"address": "0xBb78BcaB8e39C38C6E019fe49E43b2591FAa6a58"
}
},
"variableDebtUSDC": {
"kovan": {
"address": "0x5d4d415f627a10b20f5B3E8A1bbB4D3190761cE0"
},
"hardhat": {
"address": "0xF5B3b70cb53852617B1fde19242bED043A885B4B"
}
},
"aSUSD": {
"kovan": {
"address": "0x6a179aD153474df2af72b963145C1310727F65a7"
},
"hardhat": {
"address": "0x4bb47D17F31181c8BE088CE21574B4e973212C39"
}
},
"strategySUSD": {
"kovan": {
"address": "0x570114BcC09d440A7973e406A5c1b55C394c90aD"
},
"hardhat": {
"address": "0x632a0Cf1e008011CC3185c9989205aa29BF267Df"
}
},
"aTUSD": {
"kovan": {
"address": "0x0290a0b6B5D249fD98F31Ae887F6d5B4d6C4A56F"
},
"hardhat": {
"address": "0x2A3CcaB4Fb2A3B34f6A819Cfc50918fe96D64122"
}
},
"strategyTUSD": {
"kovan": {
"address": "0x9686D4f25eB0E4E72d2Eef22c66a3E1d9a42aca2"
},
"hardhat": {
"address": "0x8B151819355Bfb7dE62e5b1D7580F43B34ed86e8"
}
},
"aUNI": {
"kovan": {
"address": "0x3414b75532c400fb983a9fA22d71Cb45A05ADd2c"
},
"hardhat": {
"address": "0x388e76350476e23A80eA6403B525aDa86ed7af6E"
}
},
"strategyUNI": {
"kovan": {
"address": "0x9A01E6f57863bb03f7ED2ebad57123476e450FA9"
},
"hardhat": {
"address": "0xf86115c55192beb063C4c494E2C9CFB990235ecF"
}
},
"aUSDC": {
"kovan": {
"address": "0xB98DA540268F26Eb3A328F6c183BB3A5dCb1943b"
},
"hardhat": {
"address": "0xa8d4DF7C220903a4018C3A81BEc702fb54623bd5"
}
},
"strategyUSDC": {
"kovan": {
"address": "0xF727D07a89C98A5296CcCa71cE3Cda4f027965a9"
},
"hardhat": {
"address": "0x936b5f546a6405012AC1DC4713f29B7CE43Fb4A2"
}
},
"stableDebtUSDT": {
"kovan": {
"address": "0xc6b875BAec3472520da7c9755E2bFF98a1DbB89F"
},
"hardhat": {
"address": "0x47167e26421017FD2a619D99Cf747b5eB58371B2"
}
},
"variableDebtUSDT": {
"kovan": {
"address": "0x935626db98525589969745e5edc2C9256E380e17"
},
"hardhat": {
"address": "0xBfd65BbF3fbF0bFB0f0053e092EB690904eC6876"
}
},
"stableDebtWBTC": {
"kovan": {
"address": "0xD5f7F2A4175B40cbdc53c952103AB427656D9C81"
},
"hardhat": {
"address": "0xae18C8d1A389E005faBf3234f5F81C35561c1811"
}
},
"variableDebtWBTC": {
"kovan": {
"address": "0xf11b889cB033a51391181f0180A27489484F832c"
},
"hardhat": {
"address": "0x7B3CAbCa23FafF9f02382Bc5A7BB73D46c2BE1ee"
}
},
"stableDebtWETH": {
"kovan": {
"address": "0x06Df93951238B7aBeCBDceE767bF76f0119Ef6dd"
},
"hardhat": {
"address": "0x1A06De035FA3e4339f1a41C9008Ed6ba6c8f2a15"
}
},
"variableDebtWETH": {
"kovan": {
"address": "0x920e55564a59967FB7A9cbB52D806FcF9093fda9"
},
"hardhat": {
"address": "0x61641145904737b907B4e31DBdAd829B606eB111"
}
},
"stableDebtYFI": {
"kovan": {
"address": "0xFa29EA4a56192B3435D1B44c06c105d6A68934eb"
},
"hardhat": {
"address": "0x3049AA46A60B4253d6Cf122a25bBd26a0CCb6CAd"
}
},
"variableDebtYFI": {
"kovan": {
"address": "0x6888B4E246af31Abd68b8809C559dBAe005F3f8C"
},
"hardhat": {
"address": "0x1Af371fA93aFAB4F461b6f978E7918B79510896A"
}
},
"aUSDT": {
"kovan": {
"address": "0xcC43E5f28B99359A91241C3C7724329752959315"
},
"hardhat": {
"address": "0x6A45383E16554222D9AFf39c4deAd7EF598ddb95"
}
},
"strategyUSDT": {
"kovan": {
"address": "0x258B11Fe8840465aB532672Cae7552E9b9164868"
},
"hardhat": {
"address": "0x08fd990609A0Ed943858a7493c7105E2CC784784"
}
},
"aWBTC": {
"kovan": {
"address": "0x5Df7c6D2bC373B5D4401A5Fb53c2ca0c5D54f3D9"
},
"hardhat": {
"address": "0xEDE8C583A3fB6DcfC1a991E5B1F9C1b0b29ca60d"
}
},
"strategyWBTC": {
"kovan": {
"address": "0x9499FD7ca03BC886D9D5206Eb13ef49aFAd762D9"
},
"hardhat": {
"address": "0x763b103B7EFEbb21Acc2b50b134681E0b5ecB247"
}
},
"aWETH": {
"kovan": {
"address": "0xC304Ee9c505e4Aa890E4738df1cd51eF344AE1af"
},
"hardhat": {
"address": "0x24aAB62Ae5595aACae2A0fC10aA31006Cb7dC4ef"
}
},
"strategyWETH": {
"kovan": {
"address": "0x6dcb41D1EA0e01d5b411B51459F14c8DEe0271B1"
},
"hardhat": {
"address": "0x75e2e836409aF032Fc182F2e9D6212336E2E7026"
}
},
"aYFI": {
"kovan": {
"address": "0xb88b11E148741c7182e3dF7f50f445174BFA6C80"
},
"hardhat": {
"address": "0xE4b29Db05C1A3749d085E9eF41dC2378eE530dF0"
}
},
"strategyYFI": {
"kovan": {
"address": "0x0bDd002c01D54129ef2D258Ce39fEeC63E37d0DF"
},
"hardhat": {
"address": "0x8c82e998506DCF9ef46518182DaF18ae962d4b3C"
}
},
"stableDebtZRX": {
"kovan": {
"address": "0x76309814279AbD6bfCA3722Db8dEC502F98012E1"
},
"hardhat": {
"address": "0x929ef1D4eB03724462e59219506CbD5Bcf2Cce38"
}
},
"variableDebtZRX": {
"kovan": {
"address": "0x818215a596C8Cc8D27A4dC76c12e8A138570ed9B"
},
"hardhat": {
"address": "0xDf5E00D37C010cE5FA334234c8E391F82e90fA2e"
}
},
"aZRX": {
"kovan": {
"address": "0x66Bf0A6886AC7024015C8020B0aFEdacD41b60c3"
},
"hardhat": {
"address": "0x255AE9d92694fE823D099b42ff8088770B700029"
}
},
"strategyZRX": {
"kovan": {
"address": "0xC0499607b25dd626DF59343d7fCF246E4D875136"
},
"hardhat": {
"address": "0xaDF23b1cAa6a7B3b077c432794FfF80A4b935cdF"
}
}
}

View File

@ -8,13 +8,14 @@ import {BUIDLEREVM_CHAINID, COVERAGE_CHAINID} from './helpers/buidler-constants'
import '@nomiclabs/hardhat-ethers';
import '@nomiclabs/hardhat-waffle';
import '@nomiclabs/hardhat-etherscan';
import 'temp-hardhat-etherscan';
import 'hardhat-gas-reporter';
import 'hardhat-typechain';
const SKIP_LOAD = process.env.SKIP_LOAD === 'true';
const DEFAULT_BLOCK_GAS_LIMIT = 12450000;
const DEFAULT_GAS_PRICE = 10;
const DEFAULT_GAS_MUL = 2;
const DEFAULT_GAS_PRICE = 2000000000;
const HARDFORK = 'istanbul';
const INFURA_KEY = process.env.INFURA_KEY || '';
const ETHERSCAN_KEY = process.env.ETHERSCAN_KEY || '';
@ -40,7 +41,8 @@ const getCommonNetworkConfig = (networkName: eEthereumNetwork, networkId: number
url: `https://${networkName}.infura.io/v3/${INFURA_KEY}`,
hardfork: HARDFORK,
blockGasLimit: DEFAULT_BLOCK_GAS_LIMIT,
gasMultiplier: DEFAULT_GAS_PRICE,
gasMultiplier: DEFAULT_GAS_MUL,
gasPrice: DEFAULT_GAS_PRICE,
chainId: networkId,
accounts: {
mnemonic: MNEMONIC,

View File

@ -53,7 +53,9 @@ export const getReservesConfigByPool = (pool: AavePools): iMultiPoolsAssets<IRes
pool
);
export const getGenesisPoolAdmin = async (config: ICommonConfiguration) => {
export const getGenesisPoolAdmin = async (
config: ICommonConfiguration
): Promise<tEthereumAddress> => {
const currentNetwork = DRE.network.name;
const targetAddress = getParamPerNetwork(config.PoolAdmin, <eEthereumNetwork>currentNetwork);
if (targetAddress) {
@ -66,7 +68,9 @@ export const getGenesisPoolAdmin = async (config: ICommonConfiguration) => {
return addressList[addressIndex];
};
export const getEmergencyAdmin = async (config: ICommonConfiguration) => {
export const getEmergencyAdmin = async (
config: ICommonConfiguration
): Promise<tEthereumAddress> => {
const currentNetwork = DRE.network.name;
const targetAddress = getParamPerNetwork(config.EmergencyAdmin, <eEthereumNetwork>currentNetwork);
if (targetAddress) {

View File

@ -18,7 +18,7 @@ import {getReservesConfigByPool} from './configuration';
import {getFirstSigner} from './contracts-getters';
import {ZERO_ADDRESS} from './constants';
import {
AaveProtocolTestHelpersFactory,
AaveProtocolDataProviderFactory,
ATokenFactory,
ATokensAndRatesHelperFactory,
ChainlinkProxyPriceProviderFactory,
@ -51,7 +51,12 @@ import {
Weth9MockedFactory,
WethGatewayFactory,
} from '../types';
import {withSaveAndVerify, registerContractInJsonDb, linkBytecode} from './contracts-helpers';
import {
withSaveAndVerify,
registerContractInJsonDb,
linkBytecode,
insertContractAddressInDb,
} from './contracts-helpers';
import {StableAndVariableTokensHelperFactory} from '../types/StableAndVariableTokensHelperFactory';
import {MintableDelegationErc20} from '../types/MintableDelegationErc20';
import {readArtifact as buidlerReadArtifact} from '@nomiclabs/buidler/plugins';
@ -79,13 +84,21 @@ export const deployLendingPoolAddressesProviderRegistry = async (verify?: boolea
verify
);
export const deployLendingPoolConfigurator = async (verify?: boolean) =>
withSaveAndVerify(
await new LendingPoolConfiguratorFactory(await getFirstSigner()).deploy(),
export const deployLendingPoolConfigurator = async (verify?: boolean) => {
const lendingPoolConfiguratorImpl = await new LendingPoolConfiguratorFactory(
await getFirstSigner()
).deploy();
await insertContractAddressInDb(
eContractid.LendingPoolConfiguratorImpl,
lendingPoolConfiguratorImpl.address
);
return withSaveAndVerify(
lendingPoolConfiguratorImpl,
eContractid.LendingPoolConfigurator,
[],
verify
);
};
export const deployReserveLogicLibrary = async (verify?: boolean) =>
withSaveAndVerify(
@ -159,12 +172,9 @@ export const deployAaveLibraries = async (
export const deployLendingPool = async (verify?: boolean) => {
const libraries = await deployAaveLibraries(verify);
return withSaveAndVerify(
await new LendingPoolFactory(libraries, await getFirstSigner()).deploy(),
eContractid.LendingPool,
[],
verify
);
const lendingPoolImpl = await new LendingPoolFactory(libraries, await getFirstSigner()).deploy();
await insertContractAddressInDb(eContractid.LendingPoolImpl, lendingPoolImpl.address);
return withSaveAndVerify(lendingPoolImpl, eContractid.LendingPool, [], verify);
};
export const deployPriceOracle = async (verify?: boolean) =>
@ -203,8 +213,15 @@ export const deployChainlinkProxyPriceProvider = async (
);
export const deployLendingPoolCollateralManager = async (verify?: boolean) => {
const collateralManagerImpl = await new LendingPoolCollateralManagerFactory(
await getFirstSigner()
).deploy();
await insertContractAddressInDb(
eContractid.LendingPoolCollateralManagerImpl,
collateralManagerImpl.address
);
return withSaveAndVerify(
await new LendingPoolCollateralManagerFactory(await getFirstSigner()).deploy(),
collateralManagerImpl,
eContractid.LendingPoolCollateralManager,
[],
verify
@ -241,13 +258,13 @@ export const deployWalletBalancerProvider = async (
verify
);
export const deployAaveProtocolTestHelpers = async (
export const deployAaveProtocolDataProvider = async (
addressesProvider: tEthereumAddress,
verify?: boolean
) =>
withSaveAndVerify(
await new AaveProtocolTestHelpersFactory(await getFirstSigner()).deploy(addressesProvider),
eContractid.AaveProtocolTestHelpers,
await new AaveProtocolDataProviderFactory(await getFirstSigner()).deploy(addressesProvider),
eContractid.AaveProtocolDataProvider,
[addressesProvider],
verify
);

View File

@ -1,11 +1,13 @@
import {
AaveProtocolTestHelpersFactory,
AaveProtocolDataProviderFactory,
ATokenFactory,
ATokensAndRatesHelperFactory,
DefaultReserveInterestRateStrategyFactory,
GenericLogicFactory,
InitializableAdminUpgradeabilityProxyFactory,
LendingPoolAddressesProviderFactory,
LendingPoolAddressesProviderRegistryFactory,
LendingPoolCollateralManagerFactory,
LendingPoolConfiguratorFactory,
LendingPoolFactory,
LendingRateOracleFactory,
@ -23,11 +25,13 @@ import {
UniswapLiquiditySwapAdapterFactory,
UniswapRepayAdapterFactory,
VariableDebtTokenFactory,
WalletBalanceProviderFactory,
Weth9Factory,
Weth9MockedFactory,
WethGatewayFactory,
} from '../types';
import {Ierc20DetailedFactory} from '../types/Ierc20DetailedFactory';
import {UpgradeabilityProxy} from '../types/UpgradeabilityProxy';
import {MockTokenMap} from './contracts-helpers';
import {DRE, getDb} from './misc-utils';
import {eContractid, PoolConfiguration, tEthereumAddress, TokenContractId} from './types';
@ -99,10 +103,10 @@ export const getIErc20Detailed = async (address: tEthereumAddress) =>
await getFirstSigner()
);
export const getAaveProtocolTestHelpers = async (address?: tEthereumAddress) =>
await AaveProtocolTestHelpersFactory.connect(
export const getAaveProtocolDataProvider = async (address?: tEthereumAddress) =>
await AaveProtocolDataProviderFactory.connect(
address ||
(await getDb().get(`${eContractid.AaveProtocolTestHelpers}.${DRE.network.name}`).value())
(await getDb().get(`${eContractid.AaveProtocolDataProvider}.${DRE.network.name}`).value())
.address,
await getFirstSigner()
);
@ -275,6 +279,54 @@ export const getSelfdestructTransferMock = async (address?: tEthereumAddress) =>
await getFirstSigner()
);
export const getProxy = async (address: tEthereumAddress) =>
await InitializableAdminUpgradeabilityProxyFactory.connect(address, await getFirstSigner());
export const getLendingPoolImpl = async (address?: tEthereumAddress) =>
await LendingPoolFactory.connect(
address ||
(await getDb().get(`${eContractid.LendingPoolImpl}.${DRE.network.name}`).value()).address,
await getFirstSigner()
);
export const getLendingPoolConfiguratorImpl = async (address?: tEthereumAddress) =>
await LendingPoolConfiguratorFactory.connect(
address ||
(await getDb().get(`${eContractid.LendingPoolConfiguratorImpl}.${DRE.network.name}`).value())
.address,
await getFirstSigner()
);
export const getLendingPoolCollateralManagerImpl = async (address?: tEthereumAddress) =>
await LendingPoolCollateralManagerFactory.connect(
address ||
(
await getDb()
.get(`${eContractid.LendingPoolCollateralManagerImpl}.${DRE.network.name}`)
.value()
).address,
await getFirstSigner()
);
export const getWalletProvider = async (address?: tEthereumAddress) =>
await WalletBalanceProviderFactory.connect(
address ||
(await getDb().get(`${eContractid.WalletBalanceProvider}.${DRE.network.name}`).value())
.address,
await getFirstSigner()
);
export const getLendingPoolCollateralManager = async (address?: tEthereumAddress) =>
await LendingPoolCollateralManagerFactory.connect(
address ||
(await getDb().get(`${eContractid.LendingPoolCollateralManager}.${DRE.network.name}`).value())
.address,
await getFirstSigner()
);
export const getAddressById = async (id: string) =>
(await getDb().get(`${id}.${DRE.network.name}`).value()).address;
export const getMockUniswapRouter = async (address?: tEthereumAddress) =>
await MockUniswapV2Router02Factory.connect(
address ||

View File

@ -49,6 +49,13 @@ export const insertContractAddressInDb = async (id: eContractid, address: tEther
})
.write();
export const rawInsertContractAddressInDb = async (id: string, address: tEthereumAddress) =>
await getDb()
.set(`${id}.${DRE.network.name}`, {
address,
})
.write();
export const getEthersSigners = async (): Promise<Signer[]> =>
await Promise.all(await DRE.ethers.getSigners());
@ -83,7 +90,7 @@ export const withSaveAndVerify = async <ContractType extends Contract>(
await waitForTx(instance.deployTransaction);
await registerContractInJsonDb(id, instance);
if (verify) {
await verifyContract(id, instance.address, args);
await verifyContract(instance.address, args);
}
return instance;
};

View File

@ -1,36 +1,26 @@
import {exit} from 'process';
import fs from 'fs';
import globby from 'globby';
import {file} from 'tmp-promise';
import {DRE} from './misc-utils';
const listSolidityFiles = (dir: string) => globby(`${dir}/**/*.sol`);
const fatalErrors = [
`The address provided as argument contains a contract, but its bytecode`,
`Daily limit of 100 source code submissions reached`,
`has no bytecode. Is the contract deployed to this network`,
`The constructor for`,
];
const okErrors = [`Contract source code already verified`];
const unableVerifyError = 'Fail - Unable to verify';
export const SUPPORTED_ETHERSCAN_NETWORKS = ['main', 'ropsten', 'kovan'];
export const getEtherscanPath = async (contractName: string) => {
const paths = await listSolidityFiles(DRE.config.paths.sources);
const path = paths.find((p) => p.includes(contractName));
if (!path) {
throw new Error(
`Contract path not found for ${contractName}. Check if smart contract file is equal to contractName input.`
);
}
return `${path}:${contractName}`;
};
function delay(ms: number) {
return new Promise((resolve) => setTimeout(resolve, ms));
}
export const verifyContract = async (
contractName: string,
address: string,
constructorArguments: (string | string[])[],
libraries?: string
@ -45,14 +35,13 @@ export const verifyContract = async (
`Current network ${currentNetwork} not supported. Please change to one of the next networks: ${SUPPORTED_ETHERSCAN_NETWORKS.toString()}`
);
}
const etherscanPath = await getEtherscanPath(contractName);
try {
console.log(
'[ETHERSCAN][WARNING] Delaying Etherscan verification due their API can not find newly deployed contracts'
);
const msDelay = 3000;
const times = 15;
const times = 4;
// Write a temporal file to host complex parameters for buidler-etherscan https://github.com/nomiclabs/buidler/tree/development/packages/buidler-etherscan#complex-arguments
const {fd, path, cleanup} = await file({
prefix: 'verify-params-',
@ -61,10 +50,10 @@ export const verifyContract = async (
fs.writeSync(fd, `module.exports = ${JSON.stringify([...constructorArguments])};`);
const params = {
contractName: etherscanPath,
address: address,
libraries,
constructorArgs: path,
relatedSources: true,
};
await runTaskWithRetry('verify', params, times, msDelay, cleanup);
} catch (error) {}
@ -81,7 +70,12 @@ export const runTaskWithRetry = async (
await delay(msDelay);
try {
if (times) {
if (times > 1) {
await DRE.run(task, params);
cleanup();
} else if (times === 1) {
console.log('[ETHERSCAN][WARNING] Trying to verify via uploading all sources.');
delete params.relatedSources;
await DRE.run(task, params);
cleanup();
} else {
@ -92,16 +86,26 @@ export const runTaskWithRetry = async (
}
} catch (error) {
counter--;
console.info(`[ETHERSCAN][[INFO] Retrying attemps: ${counter}.`);
console.error('[ETHERSCAN][[ERROR]', error.message);
if (fatalErrors.some((fatalError) => error.message.includes(fatalError))) {
console.error(
'[ETHERSCAN][[ERROR] Fatal error detected, skip retries and resume deployment.'
);
if (okErrors.some((okReason) => error.message.includes(okReason))) {
console.info('[ETHERSCAN][INFO] Skipping due OK response: ', error.message);
return;
}
if (fatalErrors.some((fatalError) => error.message.includes(fatalError))) {
console.error(
'[ETHERSCAN][ERROR] Fatal error detected, skip retries and resume deployment.',
error.message
);
return;
}
console.error('[ETHERSCAN][ERROR]', error.message);
console.log();
console.info(`[ETHERSCAN][[INFO] Retrying attemps: ${counter}.`);
if (error.message.includes(unableVerifyError)) {
console.log('[ETHERSCAN][WARNING] Trying to verify via uploading all sources.');
delete params.relatedSources;
}
await runTaskWithRetry(task, params, counter, msDelay, cleanup);
}
};

View File

@ -1,6 +1,6 @@
import {iMultiPoolsAssets, IReserveParams, tEthereumAddress} from './types';
import {eContractid, iMultiPoolsAssets, IReserveParams, tEthereumAddress} from './types';
import {LendingPoolConfigurator} from '../types/LendingPoolConfigurator';
import {AaveProtocolTestHelpers} from '../types/AaveProtocolTestHelpers';
import {AaveProtocolDataProvider} from '../types/AaveProtocolDataProvider';
import {
deployATokensAndRatesHelper,
deployStableAndVariableTokensHelper,
@ -11,6 +11,7 @@ import {
getLendingPoolAddressesProvider,
getStableAndVariableTokensHelper,
} from './contracts-getters';
import {insertContractAddressInDb, rawInsertContractAddressInDb} from './contracts-helpers';
export const initReservesByHelper = async (
reservesParams: iMultiPoolsAssets<IReserveParams>,
@ -89,12 +90,15 @@ export const initReservesByHelper = async (
reservesDecimals.push(reserveDecimals);
}
// Deploy stable and variable deployers
// Deploy stable and variable deployers and save implementations
const tx1 = await waitForTx(
await stableAndVariableDeployer.initDeployment(tokens, symbols, incentivesController)
);
// Deploy atokens and rate strategies
tx1.events?.forEach((event, index) => {
rawInsertContractAddressInDb(`stableDebt${symbols[index]}`, event?.args?.stableToken);
rawInsertContractAddressInDb(`variableDebt${symbols[index]}`, event?.args?.variableToken);
});
// Deploy atokens and rate strategies and save implementations
const tx2 = await waitForTx(
await atokenAndRatesDeployer.initDeployment(
tokens,
@ -103,6 +107,11 @@ export const initReservesByHelper = async (
incentivesController
)
);
tx2.events?.forEach((event, index) => {
rawInsertContractAddressInDb(`a${symbols[index]}`, event?.args?.aToken);
rawInsertContractAddressInDb(`strategy${symbols[index]}`, event?.args?.strategy);
});
console.log(` - Deployed aToken, DebtTokens and Strategy for: ${symbols.join(', ')} `);
const stableTokens: string[] = tx1.events?.map((e) => e.args?.stableToken) || [];
const variableTokens: string[] = tx1.events?.map((e) => e.args?.variableToken) || [];
@ -173,7 +182,7 @@ export const getPairsTokenAggregator = (
export const enableReservesToBorrowByHelper = async (
reservesParams: iMultiPoolsAssets<IReserveParams>,
tokenAddresses: {[symbol: string]: tEthereumAddress},
helpers: AaveProtocolTestHelpers,
helpers: AaveProtocolDataProvider,
admin: tEthereumAddress
) => {
const addressProvider = await getLendingPoolAddressesProvider();
@ -240,7 +249,7 @@ export const enableReservesToBorrowByHelper = async (
export const enableReservesAsCollateralByHelper = async (
reservesParams: iMultiPoolsAssets<IReserveParams>,
tokenAddresses: {[symbol: string]: tEthereumAddress},
helpers: AaveProtocolTestHelpers,
helpers: AaveProtocolDataProvider,
admin: tEthereumAddress
) => {
const addressProvider = await getLendingPoolAddressesProvider();

View File

@ -51,7 +51,7 @@ export enum eContractid {
DelegationAwareAToken = 'DelegationAwareAToken',
MockStableDebtToken = 'MockStableDebtToken',
MockVariableDebtToken = 'MockVariableDebtToken',
AaveProtocolTestHelpers = 'AaveProtocolTestHelpers',
AaveProtocolDataProvider = 'AaveProtocolDataProvider',
IERC20Detailed = 'IERC20Detailed',
StableDebtToken = 'StableDebtToken',
VariableDebtToken = 'VariableDebtToken',
@ -64,6 +64,9 @@ export enum eContractid {
WETH = 'WETH',
WETHMocked = 'WETHMocked',
SelfdestructTransferMock = 'SelfdestructTransferMock',
LendingPoolImpl = 'LendingPoolImpl',
LendingPoolConfiguratorImpl = 'LendingPoolConfiguratorImpl',
LendingPoolCollateralManagerImpl = 'LendingPoolCollateralManagerImpl',
MockUniswapV2Router02 = 'MockUniswapV2Router02',
UniswapLiquiditySwapAdapter = 'UniswapLiquiditySwapAdapter',
UniswapRepayAdapter = 'UniswapRepayAdapter',
@ -86,7 +89,7 @@ export enum ProtocolErrors {
CALLER_NOT_POOL_ADMIN = '33', // 'The caller must be the pool admin'
//contract specific errors
VL_AMOUNT_NOT_GREATER_THAN_0 = '1', // 'Amount must be greater than 0'
VL_INVALID_AMOUNT = '1', // 'Amount must be greater than 0'
VL_NO_ACTIVE_RESERVE = '2', // 'Action requires an active reserve'
VL_RESERVE_FROZEN = '3', // 'Action requires an unfrozen reserve'
VL_CURRENT_AVAILABLE_LIQUIDITY_NOT_ENOUGH = '4', // 'The current liquidity is not enough'

826
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -53,7 +53,10 @@
"print-contracts:kovan": "npm run hardhat:kovan -- print-contracts",
"print-contracts:main": "npm run hardhat:main -- print-contracts",
"print-contracts:ropsten": "npm run hardhat:main -- print-contracts",
"dev:deployUIProvider": "npm run buidler:kovan deploy-UiPoolDataProvider"
"dev:deployUIProvider": "npm run hardhat:kovan deploy-UiPoolDataProvider",
"kovan:verify": "npm run hardhat:kovan full:verify -- --all --verify --pool Aave",
"ropsten:verify": "npm run hardhat:ropsten full:verify -- --all --verify --pool Aave",
"mainnet:verify": "npm run hardhat:main full:verify -- --all --verify --pool Aave"
},
"devDependencies": {
"@nomiclabs/buidler": "^1.4.7",
@ -61,7 +64,6 @@
"@nomiclabs/buidler-etherscan": "^2.1.0",
"@nomiclabs/buidler-waffle": "2.0.0",
"@nomiclabs/hardhat-ethers": "^2.0.0",
"@nomiclabs/hardhat-etherscan": "^2.0.0",
"@nomiclabs/hardhat-waffle": "^2.0.0",
"@openzeppelin/contracts": "3.1.0",
"@typechain/ethers-v4": "1.0.0",
@ -74,7 +76,6 @@
"@types/mocha": "7.0.2",
"@types/node": "14.0.5",
"bignumber.js": "9.0.0",
"buidler-gas-reporter": "^0.1.4",
"buidler-typechain": "0.1.1",
"chai": "4.2.0",
"chai-bignumber": "3.0.0",
@ -94,6 +95,7 @@
"prettier-plugin-solidity": "^1.0.0-alpha.53",
"pretty-quick": "^2.0.1",
"solidity-coverage": "0.7.10",
"temp-hardhat-etherscan": "^2.0.2",
"ts-generator": "0.0.8",
"ts-node": "^8.10.2",
"tslint": "^6.1.2",

View File

@ -3,7 +3,7 @@ import {
deployLendingPoolCollateralManager,
deployMockFlashLoanReceiver,
deployWalletBalancerProvider,
deployAaveProtocolTestHelpers,
deployAaveProtocolDataProvider,
deployWETHGateway,
} from '../../helpers/contracts-deployments';
import {
@ -41,7 +41,7 @@ task('dev:initialize-lending-pool', 'Initialize lending pool configuration.')
filterMapBy(allTokenAddresses, (key: string) => !key.includes('UNI_'))
);
const testHelpers = await deployAaveProtocolTestHelpers(addressesProvider.address, verify);
const testHelpers = await deployAaveProtocolDataProvider(addressesProvider.address, verify);
const reservesParams = getReservesConfigByPool(AavePools.proto);
@ -77,7 +77,7 @@ task('dev:initialize-lending-pool', 'Initialize lending pool configuration.')
await deployWalletBalancerProvider(addressesProvider.address, verify);
await insertContractAddressInDb(eContractid.AaveProtocolTestHelpers, testHelpers.address);
await insertContractAddressInDb(eContractid.AaveProtocolDataProvider, testHelpers.address);
const lendingPoolAddress = await addressesProvider.getLendingPool();
const wethAddress = await getWethAddress(poolConfig);

View File

@ -3,7 +3,7 @@ import {getParamPerNetwork} from '../../helpers/contracts-helpers';
import {
deployLendingPoolCollateralManager,
deployWalletBalancerProvider,
deployAaveProtocolTestHelpers,
deployAaveProtocolDataProvider,
deployWETHGateway,
} from '../../helpers/contracts-deployments';
import {loadPoolConfig, ConfigNames, getWethAddress} from '../../helpers/configuration';
@ -32,7 +32,7 @@ task('full:initialize-lending-pool', 'Initialize lending pool configuration.')
const addressesProvider = await getLendingPoolAddressesProvider();
const testHelpers = await deployAaveProtocolTestHelpers(addressesProvider.address, verify);
const testHelpers = await deployAaveProtocolDataProvider(addressesProvider.address, verify);
const admin = await addressesProvider.getPoolAdmin();
if (!reserveAssets) {

179
tasks/full/6_verify.ts Normal file
View File

@ -0,0 +1,179 @@
import {zeroAddress} from 'ethereumjs-util';
import {task} from 'hardhat/config';
import {loadPoolConfig, ConfigNames, getWethAddress} from '../../helpers/configuration';
import {ZERO_ADDRESS} from '../../helpers/constants';
import {
getAaveProtocolDataProvider,
getAddressById,
getLendingPool,
getLendingPoolAddressesProvider,
getLendingPoolAddressesProviderRegistry,
getLendingPoolCollateralManager,
getLendingPoolCollateralManagerImpl,
getLendingPoolConfiguratorImpl,
getLendingPoolConfiguratorProxy,
getLendingPoolImpl,
getWalletProvider,
getWETHGateway,
} from '../../helpers/contracts-getters';
import {getParamPerNetwork} from '../../helpers/contracts-helpers';
import {verifyContract} from '../../helpers/etherscan-verification';
import {eEthereumNetwork, ICommonConfiguration} from '../../helpers/types';
task('full:verify', 'Deploy oracles for dev enviroment')
.addFlag('verify', 'Verify proxy contracts at Etherscan')
.addFlag('all', 'Verify all contracts at Etherscan')
.addParam('pool', `Pool name to retrieve configuration, supported: ${Object.values(ConfigNames)}`)
.setAction(async ({verify, all, pool}, localDRE) => {
await localDRE.run('set-DRE');
const network = localDRE.network.name as eEthereumNetwork;
const poolConfig = loadPoolConfig(pool);
const {ReserveAssets, ReservesConfig} = poolConfig as ICommonConfiguration;
const addressesProvider = await getLendingPoolAddressesProvider();
const addressesProviderRegistry = await getLendingPoolAddressesProviderRegistry();
const lendingPoolProxy = await getLendingPool();
const lendingPoolConfigurator = await getLendingPoolConfiguratorProxy();
const lendingPoolCollateralManager = await getLendingPoolCollateralManager();
if (!verify) {
return;
}
if (all) {
const lendingPoolImpl = await getLendingPoolImpl();
const lendingPoolConfiguratorImpl = await getLendingPoolConfiguratorImpl();
const lendingPoolCollateralManagerImpl = await getLendingPoolCollateralManagerImpl();
const dataProvider = await getAaveProtocolDataProvider();
const walletProvider = await getWalletProvider();
const wethGateway = await getWETHGateway();
// Address Provider
console.log('\n- Verifying address provider...\n');
await verifyContract(addressesProvider.address, []);
// Address Provider Registry
console.log('\n- Verifying address provider registry...\n');
await verifyContract(addressesProviderRegistry.address, []);
// Lending Pool implementation
console.log('\n- Verifying LendingPool Implementation...\n');
await verifyContract(lendingPoolImpl.address, []);
// Lending Pool Configurator implementation
console.log('\n- Verifying LendingPool Configurator Implementation...\n');
await verifyContract(lendingPoolConfiguratorImpl.address, []);
// Lending Pool Collateral Manager implementation
console.log('\n- Verifying LendingPool Collateral Manager Implementation...\n');
await verifyContract(lendingPoolCollateralManagerImpl.address, []);
// Test helpers
console.log('\n- Verifying Aave Provider Helpers...\n');
await verifyContract(dataProvider.address, [addressesProvider.address]);
// Wallet balance provider
console.log('\n- Verifying Wallet Balance Provider...\n');
await verifyContract(walletProvider.address, [addressesProvider.address]);
// WETHGateway
console.log('\n- Verifying WETHGateway...\n');
await verifyContract(wethGateway.address, [
await getWethAddress(poolConfig),
lendingPoolProxy.address,
]);
}
// Lending Pool proxy
console.log('\n- Verifying Lending Pool Proxy...\n');
await verifyContract(lendingPoolProxy.address, [addressesProvider.address]);
// LendingPool Conf proxy
console.log('\n- Verifying Lending Pool Configurator Proxy...\n');
await verifyContract(lendingPoolConfigurator.address, [addressesProvider.address]);
// Proxy collateral manager
console.log('\n- Verifying Lending Pool Collateral Manager Proxy...\n');
await verifyContract(lendingPoolCollateralManager.address, []);
// Tokens verification
const DAI = getParamPerNetwork(ReserveAssets, network).DAI;
const stableDebtDai = await getAddressById('stableDebtDAI');
const variableDebtDai = await getAddressById('variableDebtDAI');
const aDAI = await getAddressById('aDAI');
const {
stableDebtTokenAddress,
variableDebtTokenAddress,
aTokenAddress,
interestRateStrategyAddress,
} = await lendingPoolProxy.getReserveData(DAI);
const {
baseVariableBorrowRate,
variableRateSlope1,
variableRateSlope2,
stableRateSlope1,
stableRateSlope2,
} = ReservesConfig.DAI;
// Proxy Stable Debt
console.log('\n- Verifying DAI Stable Debt Token proxy...\n');
await verifyContract(stableDebtTokenAddress, [lendingPoolConfigurator.address]);
// Proxy Variable Debt
console.log('\n- Verifying DAI Variable Debt Token proxy...\n');
await verifyContract(variableDebtTokenAddress, [lendingPoolConfigurator.address]);
// Proxy aToken
console.log('\n- Verifying aDAI Token proxy...\n');
await verifyContract(aTokenAddress, [lendingPoolConfigurator.address]);
// Strategy Rate
console.log('\n- Verifying Strategy rate...\n');
await verifyContract(interestRateStrategyAddress, [
addressesProvider.address,
baseVariableBorrowRate,
variableRateSlope1,
variableRateSlope2,
stableRateSlope1,
stableRateSlope2,
]);
// aToken
console.log('\n- Verifying aToken...\n');
await verifyContract(aDAI, [
lendingPoolProxy.address,
DAI,
ZERO_ADDRESS,
'Aave interest bearing DAI',
'aDAI',
ZERO_ADDRESS,
]);
// stableDebtToken
console.log('\n- Verifying StableDebtToken...\n');
await verifyContract(stableDebtDai, [
lendingPoolProxy.address,
DAI,
'Aave stable debt bearing DAI',
'stableDebtDAI',
ZERO_ADDRESS,
]);
// variableDebtToken
console.log('\n- Verifying VariableDebtToken...\n');
await verifyContract(variableDebtDai, [
lendingPoolProxy.address,
DAI,
'Aave variable debt bearing DAI',
'variableDebtDAI',
ZERO_ADDRESS,
]);
// DelegatedAwareAToken
console.log('\n- Verifying DelegatedAwareAToken...\n');
const UNI = getParamPerNetwork(ReserveAssets, network).UNI;
const aUNI = await getAddressById('aUNI');
await verifyContract(aUNI, [
lendingPoolProxy.address,
UNI,
ZERO_ADDRESS,
'Aave interest bearing UNI',
'aUNI',
ZERO_ADDRESS,
]);
});

View File

@ -0,0 +1,19 @@
import {task} from 'hardhat/config';
import {deployAaveProtocolDataProvider} from '../../helpers/contracts-deployments';
import {exit} from 'process';
import {getLendingPoolAddressesProvider} from '../../helpers/contracts-getters';
task('full:data-provider', 'Initialize lending pool configuration.')
.addFlag('verify', 'Verify contracts at Etherscan')
.setAction(async ({verify}, localBRE) => {
try {
await localBRE.run('set-DRE');
const addressesProvider = await getLendingPoolAddressesProvider();
await deployAaveProtocolDataProvider(addressesProvider.address, verify);
} catch (err) {
console.error(err);
exit(1);
}
});

View File

@ -20,13 +20,16 @@ task('aave:full', 'Deploy development enviroment')
console.log('Migration started\n');
console.log('1. Deploy address provider');
await localBRE.run('full:deploy-address-provider', {verify, pool: POOL_NAME});
await localBRE.run('full:deploy-address-provider', {pool: POOL_NAME});
console.log('2. Deploy lending pool');
await localBRE.run('full:deploy-lending-pool', {verify});
await localBRE.run('full:deploy-lending-pool');
console.log('3. Initialize lending pool');
await localBRE.run('full:initialize-lending-pool', {verify, pool: POOL_NAME});
await localBRE.run('full:initialize-lending-pool', {pool: POOL_NAME});
console.log('4. Veryfing contracts');
await localBRE.run('full:verify', {verify, all: true, pool: POOL_NAME});
console.log('\nFinished migrations');
printContracts();

View File

@ -9,7 +9,6 @@ interface VerifyParams {
}
task('verify-sc', 'Inits the DRE, to have access to all the plugins')
.addParam('contractName', 'Name of the Solidity smart contract')
.addParam('address', 'Ethereum address of the smart contract')
.addOptionalParam(
'libraries',
@ -20,16 +19,11 @@ task('verify-sc', 'Inits the DRE, to have access to all the plugins')
'arguments for contract constructor',
[]
)
.setAction(
async (
{contractName, address, constructorArguments = [], libraries}: VerifyParams,
localBRE
) => {
await localBRE.run('set-DRE');
.setAction(async ({address, constructorArguments = [], libraries}: VerifyParams, localBRE) => {
await localBRE.run('set-DRE');
checkVerification();
checkVerification();
const result = await verifyContract(contractName, address, constructorArguments, libraries);
return result;
}
);
const result = await verifyContract(address, constructorArguments, libraries);
return result;
});

View File

@ -16,7 +16,7 @@ import {
deployLendingPoolCollateralManager,
deployMockFlashLoanReceiver,
deployWalletBalancerProvider,
deployAaveProtocolTestHelpers,
deployAaveProtocolDataProvider,
deployLendingRateOracle,
deployStableAndVariableTokensHelper,
deployATokensAndRatesHelper,
@ -238,9 +238,9 @@ const buildTestEnv = async (deployer: Signer, secondaryWallet: Signer) => {
const reservesParams = getReservesConfigByPool(AavePools.proto);
const testHelpers = await deployAaveProtocolTestHelpers(addressesProvider.address);
const testHelpers = await deployAaveProtocolDataProvider(addressesProvider.address);
await insertContractAddressInDb(eContractid.AaveProtocolTestHelpers, testHelpers.address);
await insertContractAddressInDb(eContractid.AaveProtocolDataProvider, testHelpers.address);
const admin = await deployer.getAddress();
console.log('Initialize configuration');

View File

@ -20,7 +20,7 @@ makeSuite('AToken: Permit', (testEnv: TestEnv) => {
it('Checks the domain separator', async () => {
const DOMAIN_SEPARATOR_ENCODED = getATokenDomainSeparatorPerNetwork(
eEthereumNetwork.buidlerevm,
eEthereumNetwork.hardhat,
poolConfig
);

View File

@ -48,16 +48,6 @@ makeSuite('LendingPoolConfigurator', (testEnv: TestEnv) => {
).to.be.revertedWith(RC_INVALID_LIQ_BONUS);
});
it('Reverts trying to set an invalid reserve decimals', async () => {
const {configurator, weth} = testEnv;
const invalidDecimals = 256;
await expect(configurator.setReserveDecimals(weth.address, invalidDecimals)).to.be.revertedWith(
RC_INVALID_DECIMALS
);
});
it('Reverts trying to set an invalid reserve factor', async () => {
const {configurator, weth} = testEnv;
@ -508,14 +498,6 @@ makeSuite('LendingPoolConfigurator', (testEnv: TestEnv) => {
).to.be.revertedWith(CALLER_NOT_POOL_ADMIN);
});
it('Check the onlyAaveAdmin on setReserveDecimals', async () => {
const {configurator, users, weth} = testEnv;
await expect(
configurator.connect(users[2].signer).setReserveDecimals(weth.address, '80'),
CALLER_NOT_POOL_ADMIN
).to.be.revertedWith(CALLER_NOT_POOL_ADMIN);
});
it('Check the onlyAaveAdmin on setLiquidationBonus', async () => {
const {configurator, users, weth} = testEnv;
await expect(

View File

@ -3,7 +3,7 @@ import {Signer} from 'ethers';
import {
getLendingPool,
getLendingPoolAddressesProvider,
getAaveProtocolTestHelpers,
getAaveProtocolDataProvider,
getAToken,
getMintableErc20,
getLendingPoolConfiguratorProxy,
@ -16,7 +16,7 @@ import {
} from '../../helpers/contracts-getters';
import {tEthereumAddress} from '../../helpers/types';
import {LendingPool} from '../../types/LendingPool';
import {AaveProtocolTestHelpers} from '../../types/AaveProtocolTestHelpers';
import {AaveProtocolDataProvider} from '../../types/AaveProtocolDataProvider';
import {MintableErc20 as MintableERC20} from '../../types/MintableErc20';
import {AToken} from '../../types/AToken';
import {LendingPoolConfigurator} from '../../types/LendingPoolConfigurator';
@ -49,7 +49,7 @@ export interface TestEnv {
pool: LendingPool;
configurator: LendingPoolConfigurator;
oracle: PriceOracle;
helpersContract: AaveProtocolTestHelpers;
helpersContract: AaveProtocolDataProvider;
weth: Weth9Mocked;
aWETH: AToken;
dai: MintableERC20;
@ -75,7 +75,7 @@ const testEnv: TestEnv = {
users: [] as SignerWithAddress[],
pool: {} as LendingPool,
configurator: {} as LendingPoolConfigurator,
helpersContract: {} as AaveProtocolTestHelpers,
helpersContract: {} as AaveProtocolDataProvider,
oracle: {} as PriceOracle,
weth: {} as Weth9Mocked,
aWETH: {} as AToken,
@ -112,7 +112,7 @@ export async function initializeMakeSuite() {
testEnv.addressesProvider = await getLendingPoolAddressesProvider();
testEnv.registry = await getLendingPoolAddressesProviderRegistry();
testEnv.helpersContract = await getAaveProtocolTestHelpers();
testEnv.helpersContract = await getAaveProtocolDataProvider();
const allTokens = await testEnv.helpersContract.getAllATokens();

View File

@ -222,7 +222,22 @@
"user": "1",
"useAsCollateral": "false"
},
"expected": "User deposit is already being used as collateral"
"expected": "revert"
}
]
},
{
"description": "User 1 reenables WETH as collateral",
"actions": [
{
"name": "setUseAsCollateral",
"args": {
"reserve": "WETH",
"user": "1",
"useAsCollateral": "true"
},
"expected": "success"
}
]
}

View File

@ -11,10 +11,10 @@ import {
import {tEthereumAddress} from '../../../helpers/types';
import BigNumber from 'bignumber.js';
import {getDb, DRE} from '../../../helpers/misc-utils';
import {AaveProtocolTestHelpers} from '../../../types/AaveProtocolTestHelpers';
import {AaveProtocolDataProvider} from '../../../types/AaveProtocolDataProvider';
export const getReserveData = async (
helper: AaveProtocolTestHelpers,
helper: AaveProtocolDataProvider,
reserve: tEthereumAddress
): Promise<ReserveData> => {
const [reserveData, tokenAddresses, rateOracle, token] = await Promise.all([
@ -74,7 +74,7 @@ export const getReserveData = async (
export const getUserData = async (
pool: LendingPool,
helper: AaveProtocolTestHelpers,
helper: AaveProtocolDataProvider,
reserve: string,
user: tEthereumAddress,
sender?: tEthereumAddress
@ -116,7 +116,7 @@ export const getReserveAddressFromSymbol = async (symbol: string) => {
const getATokenUserData = async (
reserve: string,
user: string,
helpersContract: AaveProtocolTestHelpers
helpersContract: AaveProtocolDataProvider
) => {
const aTokenAddress: string = (await helpersContract.getReserveTokensAddresses(reserve))
.aTokenAddress;

View File

@ -31,28 +31,61 @@ makeSuite('LendingPoolAddressesProvider', (testEnv: TestEnv) => {
await expect(
addressesProvider.setAddress(
utils.keccak256(utils.toUtf8Bytes('RANDOM_ID')),
mockAddress,
ZERO_ADDRESS
mockAddress
)
).to.be.revertedWith(INVALID_OWNER_REVERT_MSG);
await expect(
addressesProvider.setAddressAsProxy(
utils.keccak256(utils.toUtf8Bytes('RANDOM_ID')),
mockAddress
)
).to.be.revertedWith(INVALID_OWNER_REVERT_MSG);
});
it('Tests adding both a proxied and non-proxied addres with `setAddress()`', async () => {
it('Tests adding a proxied address with `setAddressAsProxy()`', async () => {
const {addressesProvider, users} = testEnv;
const {INVALID_OWNER_REVERT_MSG} = ProtocolErrors;
const currentAddressesProviderOwner = users[1];
const mockNonProxiedAddress = createRandomAddress();
const nonProxiedAddressId = utils.keccak256(utils.toUtf8Bytes('RANDOM_NON_PROXIED'));
const mockLendingPool = await deployLendingPool();
const proxiedAddressId = utils.keccak256(utils.toUtf8Bytes('RANDOM_PROXIED'));
const proxiedAddressSetReceipt = await waitForTx(
await addressesProvider
.connect(currentAddressesProviderOwner.signer)
.setAddressAsProxy(proxiedAddressId, mockLendingPool.address)
);
if (!proxiedAddressSetReceipt.events || proxiedAddressSetReceipt.events?.length < 1) {
throw new Error('INVALID_EVENT_EMMITED');
}
expect(proxiedAddressSetReceipt.events[0].event).to.be.equal('ProxyCreated');
expect(proxiedAddressSetReceipt.events[1].event).to.be.equal('AddressSet');
expect(proxiedAddressSetReceipt.events[1].args?.id).to.be.equal(proxiedAddressId);
expect(proxiedAddressSetReceipt.events[1].args?.newAddress).to.be.equal(
mockLendingPool.address
);
expect(proxiedAddressSetReceipt.events[1].args?.hasProxy).to.be.equal(true);
});
it('Tests adding a non proxied address with `setAddress()`', async () => {
const {addressesProvider, users} = testEnv;
const {INVALID_OWNER_REVERT_MSG} = ProtocolErrors;
const currentAddressesProviderOwner = users[1];
const mockNonProxiedAddress = createRandomAddress();
const nonProxiedAddressId = utils.keccak256(utils.toUtf8Bytes('RANDOM_NON_PROXIED'));
const nonProxiedAddressSetReceipt = await waitForTx(
await addressesProvider
.connect(currentAddressesProviderOwner.signer)
.setAddress(nonProxiedAddressId, mockNonProxiedAddress, ZERO_ADDRESS)
.setAddress(nonProxiedAddressId, mockNonProxiedAddress)
);
expect(mockNonProxiedAddress.toLowerCase()).to.be.equal(
@ -70,22 +103,5 @@ makeSuite('LendingPoolAddressesProvider', (testEnv: TestEnv) => {
);
expect(nonProxiedAddressSetReceipt.events[0].args?.hasProxy).to.be.equal(false);
const proxiedAddressSetReceipt = await waitForTx(
await addressesProvider
.connect(currentAddressesProviderOwner.signer)
.setAddress(proxiedAddressId, ZERO_ADDRESS, mockLendingPool.address)
);
if (!proxiedAddressSetReceipt.events || proxiedAddressSetReceipt.events?.length < 2) {
throw new Error('INVALID_EVENT_EMMITED');
}
expect(proxiedAddressSetReceipt.events[0].event).to.be.equal('ProxyCreated');
expect(proxiedAddressSetReceipt.events[1].event).to.be.equal('AddressSet');
expect(proxiedAddressSetReceipt.events[1].args?.id).to.be.equal(proxiedAddressId);
expect(proxiedAddressSetReceipt.events[1].args?.newAddress).to.be.equal(
mockLendingPool.address
);
expect(proxiedAddressSetReceipt.events[1].args?.hasProxy).to.be.equal(true);
});
});