mirror of
https://github.com/Instadapp/aave-protocol-v2.git
synced 2024-07-29 21:47:30 +00:00
Merge branch '140-setup-mainnet-fork-simulation-environment-based-on-tenderly' into 'master'
Add Mainnet fork, deployment check-list, add Tenderly integration Closes #140 See merge request aave-tech/protocol-v2!160
This commit is contained in:
commit
200c02e081
122
README.md
122
README.md
|
@ -1 +1,123 @@
|
|||
# Aave Protocol v2
|
||||
|
||||
This repository contains the smart contracts source code and markets configuration for Aave Protocol V2. The repository uses Docker Compose and Hardhat as development enviroment for compilation, testing and deployment tasks.
|
||||
|
||||
## What is Aave?
|
||||
|
||||
Aave is a decentralized non-custodial liquidity markets protocol where users can participate as depositors or borrowers. Depositors provide liquidity to the market to earn a passive income, while borrowers are able to borrow in an overcollateralized (perpetually) or undercollateralized (one-block liquidity) fashion.
|
||||
|
||||
## Documentation
|
||||
|
||||
The documentation of Aave V2 is in the following [Aave V2 documentation](https://docs.aave.com/v2/-MJXUluJ2u1DiL-VU6MM) link. At the documentation you can learn more about the protocol, see the contract interfaces, integration guides and audits.
|
||||
|
||||
For getting the latest contracts addresses, please check the [Deployed contracts](https://docs.aave.com/v2/-MJXUluJ2u1DiL-VU6MM/deployed-contracts) page at the documentation to stay up to date.
|
||||
|
||||
## Connect with the community
|
||||
|
||||
You can join at the [Discord](https://discord.com/invite/CJm5Jt3) channel or at the [Governance Forum](https://governance.aave.com/) for asking questions about the protocol or talk about Aave with other peers.
|
||||
|
||||
## Setup
|
||||
|
||||
The repository uses Docker Compose to manage sensitive keys and load the configuration. Prior any action like test or deploy, you must run `docker-compose up` to start the `contracts-env` container, and then connect to the container console via `docker-compose exec contracts-env bash`.
|
||||
|
||||
Follow the next steps to setup the repository:
|
||||
|
||||
- Install `docker` and `docker-compose`
|
||||
- Create an enviroment file named `.env` and fill the next enviroment variables
|
||||
|
||||
```
|
||||
# Mnemonic, only first address will be used
|
||||
MNEMONIC=""
|
||||
|
||||
# Add Alchemy or Infura provider keys, alchemy takes preference at the config level
|
||||
ALCHEMY_KEY=""
|
||||
INFURA_KEY=""
|
||||
|
||||
|
||||
# Optional Etherscan key, for automatize the verification of the contracts at Etherscan
|
||||
ETHERSCAN_KEY=""
|
||||
|
||||
# Optional, if you plan to use Tenderly scripts
|
||||
TENDERLY_PROJECT=""
|
||||
TENDERLY_USERNAME=""
|
||||
|
||||
```
|
||||
|
||||
## Markets configuration
|
||||
|
||||
The configurations related with the Aave Markets are located at `markets` directory. You can follow the `IAaveConfiguration` interface to create new Markets configuration or extend the current Aave configuration.
|
||||
|
||||
Each market should have his own Market configuration file, and their own set of deployment tasks, using the Aave market config and tasks as a reference.
|
||||
|
||||
## Test
|
||||
|
||||
You can run the full test suite with the following commands:
|
||||
|
||||
```
|
||||
# In one terminal
|
||||
docker-compose up
|
||||
|
||||
# Open another tab or terminal
|
||||
docker-compose exec contracts-env bash
|
||||
|
||||
# A new Bash terminal is prompted, connected to the container
|
||||
npm run test
|
||||
```
|
||||
|
||||
## Deployments
|
||||
|
||||
For deploying Aave Protocol V2, you can use the available scripts located at `package.json`. For a complete list, run `npm run` to see all the tasks.
|
||||
|
||||
### Kovan deployment
|
||||
|
||||
```
|
||||
# In one terminal
|
||||
docker-compose up
|
||||
|
||||
# Open another tab or terminal
|
||||
docker-compose exec contracts-env bash
|
||||
|
||||
# A new Bash terminal is prompted, connected to the container
|
||||
npm run aave:kovan:full:migration
|
||||
```
|
||||
|
||||
### Mainnet fork deployment
|
||||
|
||||
You can deploy Aave Protocol v2 in a forked Mainnet chain using Hardhat built-in feature:
|
||||
|
||||
```
|
||||
# In one terminal, run a hardhat note with mainnet fork enabled
|
||||
MAINNET_FORK=true npx hardhat node
|
||||
|
||||
# In another terminal, run docker-compose
|
||||
docker-compose up
|
||||
|
||||
# Open another tab or terminal
|
||||
docker-compose exec contracts-env bash
|
||||
|
||||
# A new Bash terminal is prompted, connected to the container
|
||||
npm run aave:fork:main
|
||||
|
||||
# Contracts are now deployed at Hardhat node with Mainnet fork.
|
||||
|
||||
# You can interact with them via Hardhat console
|
||||
MAINNET_FORK=true npx hardhat console
|
||||
# Or your custom Hardhat task
|
||||
MAINNET_FORK=true npx hardhat your-custom-task
|
||||
|
||||
```
|
||||
|
||||
### Mainnet fork - Run the check list
|
||||
|
||||
For testing the deployment scripts for Mainnet release, you can run the check-list tests in a Mainnet fork using Hardhat built-in feature:
|
||||
|
||||
```
|
||||
# In another terminal, run docker-compose
|
||||
docker-compose up
|
||||
|
||||
# Open another tab or terminal
|
||||
docker-compose exec contracts-env bash
|
||||
|
||||
# A new Bash terminal is prompted, connected to the container
|
||||
npm run test:main:check-list
|
||||
```
|
||||
|
|
|
@ -1,6 +0,0 @@
|
|||
import {CommonsConfig} from './commons';
|
||||
|
||||
export const TokenSetsConfig = {
|
||||
...CommonsConfig,
|
||||
// ...TokenSetsConfigStore,
|
||||
};
|
|
@ -1,226 +0,0 @@
|
|||
import BigNumber from 'bignumber.js';
|
||||
import {eEthereumNetwork, EthereumNetwork, IUniswapConfiguration} from '../helpers/types';
|
||||
import {oneRay} from '../helpers/constants';
|
||||
|
||||
import {CommonsConfig} from './commons';
|
||||
|
||||
// ----------------
|
||||
// POOL--SPECIFIC PARAMS
|
||||
// ----------------
|
||||
|
||||
export const UniswapConfig: IUniswapConfiguration = {
|
||||
...CommonsConfig,
|
||||
ConfigName: 'Uniswap',
|
||||
ProviderId: 2,
|
||||
ReservesConfig: {
|
||||
DAI: {
|
||||
baseVariableBorrowRate: new BigNumber(0.01).multipliedBy(oneRay).toFixed(),
|
||||
variableRateSlope1: new BigNumber(0.07).multipliedBy(oneRay).toFixed(),
|
||||
variableRateSlope2: new BigNumber(0.6).multipliedBy(oneRay).toFixed(),
|
||||
stableRateSlope1: new BigNumber(0.06).multipliedBy(oneRay).toFixed(),
|
||||
stableRateSlope2: new BigNumber(0.6).multipliedBy(oneRay).toFixed(),
|
||||
baseLTVAsCollateral: '-1',
|
||||
liquidationThreshold: '8000',
|
||||
liquidationBonus: '10500',
|
||||
borrowingEnabled: true,
|
||||
stableBorrowRateEnabled: false,
|
||||
reserveDecimals: '18',
|
||||
},
|
||||
USDC: {
|
||||
baseVariableBorrowRate: new BigNumber(0.01).multipliedBy(oneRay).toFixed(),
|
||||
variableRateSlope1: new BigNumber(0.07).multipliedBy(oneRay).toFixed(),
|
||||
variableRateSlope2: new BigNumber(0.6).multipliedBy(oneRay).toFixed(),
|
||||
stableRateSlope1: new BigNumber(0.06).multipliedBy(oneRay).toFixed(),
|
||||
stableRateSlope2: new BigNumber(0.6).multipliedBy(oneRay).toFixed(),
|
||||
baseLTVAsCollateral: '-1',
|
||||
liquidationThreshold: '8000',
|
||||
liquidationBonus: '10500',
|
||||
borrowingEnabled: true,
|
||||
stableBorrowRateEnabled: false,
|
||||
reserveDecimals: '6',
|
||||
},
|
||||
USDT: {
|
||||
baseVariableBorrowRate: new BigNumber(0.01).multipliedBy(oneRay).toFixed(),
|
||||
variableRateSlope1: new BigNumber(0.07).multipliedBy(oneRay).toFixed(),
|
||||
variableRateSlope2: new BigNumber(0.6).multipliedBy(oneRay).toFixed(),
|
||||
stableRateSlope1: new BigNumber(0.06).multipliedBy(oneRay).toFixed(),
|
||||
stableRateSlope2: new BigNumber(0.6).multipliedBy(oneRay).toFixed(),
|
||||
baseLTVAsCollateral: '-1',
|
||||
liquidationThreshold: '8000',
|
||||
liquidationBonus: '10500',
|
||||
borrowingEnabled: true,
|
||||
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(),
|
||||
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_LEND_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: '5100',
|
||||
liquidationThreshold: '6600',
|
||||
liquidationBonus: '11000',
|
||||
borrowingEnabled: false,
|
||||
stableBorrowRateEnabled: false,
|
||||
reserveDecimals: '18',
|
||||
},
|
||||
UNI_LINK_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: '6300',
|
||||
liquidationThreshold: '6800',
|
||||
liquidationBonus: '11000',
|
||||
borrowingEnabled: false,
|
||||
stableBorrowRateEnabled: false,
|
||||
reserveDecimals: '18',
|
||||
},
|
||||
UNI_MKR_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_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]: {},
|
||||
[eEthereumNetwork.hardhat]: {},
|
||||
[eEthereumNetwork.coverage]: {},
|
||||
[EthereumNetwork.kovan]: {
|
||||
DAI: '0x6F47077D3B6645Cb6fb7A29D280277EC1e5fFD90',
|
||||
USDC: '0x672c1C0d1130912D83664011E7960a42E8cA05D5',
|
||||
USDT: '0xCC833A6522721B3252e7578c5BCAF65738B75Fc3',
|
||||
UNI_DAI_ETH: '0x0338C40020Bf886c11406115fD1ba205Ef1D9Ff9',
|
||||
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_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_LEND_ETH: '0xF4C8Db2d999b024bBB6c6022566503eD41f2AC1E',
|
||||
UNI_LINK_ETH: '0xE2A639Beb647d7F709ca805ABa760bBEfdbE37e3',
|
||||
UNI_MKR_ETH: '0xEe40a5E8F3732bE6ECDb5A90e23D0b7bF0D4a73c',
|
||||
UNI_SETH_ETH: '0x517D40E49660c7705b2e99eEFA6d7B0E9Ba5BF10',
|
||||
UNI_USDC_ETH: '0x444315Ee92F2bb3579293C17B07194227fA99bF0',
|
||||
},
|
||||
},
|
||||
ReserveAssets: {
|
||||
[eEthereumNetwork.hardhat]: {},
|
||||
[eEthereumNetwork.buidlerevm]: {},
|
||||
[eEthereumNetwork.coverage]: {},
|
||||
[EthereumNetwork.kovan]: {
|
||||
DAI: '0xFf795577d9AC8bD7D90Ee22b6C1703490b6512FD',
|
||||
USDC: '0xe22da380ee6B445bb8273C81944ADEB6E8450422',
|
||||
USDT: '0x13512979ADE267AB5100878E2e0f485B568328a4',
|
||||
WETH: '0xd0a1e359811322d97991e03f863a0c30c2cf029c',
|
||||
UNI_DAI_ETH: '0x2e0086b5343101203ADeE40160ca1BD91E29fF75',
|
||||
UNI_LEND_ETH: '0x7615cd666F867406C64E558B9CCC3883e7EC9BA8',
|
||||
UNI_LINK_ETH: '0xFb9AAc184e79025f936E9C4EF3047Ad4889Df4a8',
|
||||
UNI_MKR_ETH: '0xB31a1c30f38cD68e8177566Ef950d7bc3C81DaCF',
|
||||
UNI_SETH_ETH: '0xCF457d8Bb8D8f54Af1ea1B3710231e89bd6CFbfe',
|
||||
UNI_USDC_ETH: '0x34eA1aB2a43ee696914fc3C0d3e517fA666B9e8D',
|
||||
},
|
||||
[EthereumNetwork.ropsten]: {
|
||||
DAI: '0xf80A32A835F79D7787E8a8ee5721D0fEaFd78108',
|
||||
USDC: '0x851dEf71f0e6A903375C1e536Bd9ff1684BAD802',
|
||||
USDT: '0xB404c51BBC10dcBE948077F18a4B8E553D160084',
|
||||
WETH: '0xc778417e063141139fce010982780140aa0cd5ab',
|
||||
UNI_DAI_ETH: '0xC245A7d35E652Cae438A1FdB13E474DF53DBB81D',
|
||||
UNI_LEND_ETH: '0xcD5DE1EDD40aBBD6efE2C306276FF56f81Bc3151',
|
||||
UNI_LINK_ETH: '0x8dcf3c8d4d69ca7C188c0A4cf219A1dcE1e510d7',
|
||||
UNI_MKR_ETH: '0xd8b7B99a9205FD0D0abFB6D7a2c13Db2681bff43',
|
||||
UNI_SETH_ETH: '0xed4597DCd234867d7A260AD24bAb8253F64940a5',
|
||||
UNI_USDC_ETH: '0x2BD65323955D08eb600074291305881d1295c4D2',
|
||||
},
|
||||
[EthereumNetwork.main]: {
|
||||
DAI: '0x6b175474e89094c44da98b954eedeac495271d0f',
|
||||
USDC: '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48',
|
||||
USDT: '0xdac17f958d2ee523a2206206994597c13d831ec7',
|
||||
WETH: '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2',
|
||||
UNI_DAI_ETH: '0x2a1530c4c41db0b0b2bb646cb5eb1a67b7158667',
|
||||
UNI_LEND_ETH: '0xcaa7e4656f6a2b59f5f99c745f91ab26d1210dce',
|
||||
UNI_LINK_ETH: '0xf173214c720f58e03e194085b1db28b50acdeead',
|
||||
UNI_MKR_ETH: '0x2c4bd064b998838076fa341a83d007fc2fa50957',
|
||||
UNI_SETH_ETH: '0xe9cf7887b93150d4f2da7dfc6d502b216438f244',
|
||||
UNI_USDC_ETH: '0x97dec872013f6b5fb443861090ad931542878126',
|
||||
},
|
||||
},
|
||||
};
|
|
@ -8,14 +8,14 @@ import {IPriceOracleGetter} from '../interfaces/IPriceOracleGetter.sol';
|
|||
import {IChainlinkAggregator} from '../interfaces/IChainlinkAggregator.sol';
|
||||
import {SafeERC20} from '../dependencies/openzeppelin/contracts/SafeERC20.sol';
|
||||
|
||||
/// @title ChainlinkProxyPriceProvider
|
||||
/// @title AaveOracle
|
||||
/// @author Aave
|
||||
/// @notice Proxy smart contract to get the price of an asset from a price source, with Chainlink Aggregator
|
||||
/// smart contracts as primary option
|
||||
/// - If the returned price by a Chainlink aggregator is <= 0, the call is forwarded to a fallbackOracle
|
||||
/// - Owned by the Aave governance system, allowed to add sources for assets, replace them
|
||||
/// and change the fallbackOracle
|
||||
contract ChainlinkProxyPriceProvider is IPriceOracleGetter, Ownable {
|
||||
contract AaveOracle is IPriceOracleGetter, Ownable {
|
||||
using SafeERC20 for IERC20;
|
||||
|
||||
event WethSet(address indexed weth);
|
|
@ -10,11 +10,15 @@ import {ReserveConfiguration} from '../libraries/configuration/ReserveConfigurat
|
|||
import {UserConfiguration} from '../libraries/configuration/UserConfiguration.sol';
|
||||
import {IStableDebtToken} from '../tokenization/interfaces/IStableDebtToken.sol';
|
||||
import {IVariableDebtToken} from '../tokenization/interfaces/IVariableDebtToken.sol';
|
||||
import 'hardhat/console.sol';
|
||||
|
||||
contract AaveProtocolDataProvider {
|
||||
using ReserveConfiguration for ReserveConfiguration.Map;
|
||||
using UserConfiguration for UserConfiguration.Map;
|
||||
|
||||
address constant MKR = 0x9f8F72aA9304c8B593d555F12eF6589cC3A579A2;
|
||||
address constant ETH = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE;
|
||||
|
||||
struct TokenData {
|
||||
string symbol;
|
||||
address tokenAddress;
|
||||
|
@ -31,10 +35,16 @@ contract AaveProtocolDataProvider {
|
|||
address[] memory reserves = pool.getReservesList();
|
||||
TokenData[] memory reservesTokens = new TokenData[](reserves.length);
|
||||
for (uint256 i = 0; i < reserves.length; i++) {
|
||||
if (reserves[i] == MKR) {
|
||||
reservesTokens[i] = TokenData({symbol: 'MKR', tokenAddress: reserves[i]});
|
||||
continue;
|
||||
}
|
||||
if (reserves[i] == ETH) {
|
||||
reservesTokens[i] = TokenData({symbol: 'ETH', tokenAddress: reserves[i]});
|
||||
continue;
|
||||
}
|
||||
reservesTokens[i] = TokenData({
|
||||
symbol: (reserves[i] == 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE)
|
||||
? 'ETH'
|
||||
: IERC20Detailed(reserves[i]).symbol(),
|
||||
symbol: IERC20Detailed(reserves[i]).symbol(),
|
||||
tokenAddress: reserves[i]
|
||||
});
|
||||
}
|
||||
|
|
160
contracts/misc/interfaces/IUniswapV2Router01.sol
Normal file
160
contracts/misc/interfaces/IUniswapV2Router01.sol
Normal file
|
@ -0,0 +1,160 @@
|
|||
pragma solidity >=0.6.2;
|
||||
|
||||
interface IUniswapV2Router01 {
|
||||
function factory() external pure returns (address);
|
||||
|
||||
function WETH() external pure returns (address);
|
||||
|
||||
function addLiquidity(
|
||||
address tokenA,
|
||||
address tokenB,
|
||||
uint256 amountADesired,
|
||||
uint256 amountBDesired,
|
||||
uint256 amountAMin,
|
||||
uint256 amountBMin,
|
||||
address to,
|
||||
uint256 deadline
|
||||
)
|
||||
external
|
||||
returns (
|
||||
uint256 amountA,
|
||||
uint256 amountB,
|
||||
uint256 liquidity
|
||||
);
|
||||
|
||||
function addLiquidityETH(
|
||||
address token,
|
||||
uint256 amountTokenDesired,
|
||||
uint256 amountTokenMin,
|
||||
uint256 amountETHMin,
|
||||
address to,
|
||||
uint256 deadline
|
||||
)
|
||||
external
|
||||
payable
|
||||
returns (
|
||||
uint256 amountToken,
|
||||
uint256 amountETH,
|
||||
uint256 liquidity
|
||||
);
|
||||
|
||||
function removeLiquidity(
|
||||
address tokenA,
|
||||
address tokenB,
|
||||
uint256 liquidity,
|
||||
uint256 amountAMin,
|
||||
uint256 amountBMin,
|
||||
address to,
|
||||
uint256 deadline
|
||||
) external returns (uint256 amountA, uint256 amountB);
|
||||
|
||||
function removeLiquidityETH(
|
||||
address token,
|
||||
uint256 liquidity,
|
||||
uint256 amountTokenMin,
|
||||
uint256 amountETHMin,
|
||||
address to,
|
||||
uint256 deadline
|
||||
) external returns (uint256 amountToken, uint256 amountETH);
|
||||
|
||||
function removeLiquidityWithPermit(
|
||||
address tokenA,
|
||||
address tokenB,
|
||||
uint256 liquidity,
|
||||
uint256 amountAMin,
|
||||
uint256 amountBMin,
|
||||
address to,
|
||||
uint256 deadline,
|
||||
bool approveMax,
|
||||
uint8 v,
|
||||
bytes32 r,
|
||||
bytes32 s
|
||||
) external returns (uint256 amountA, uint256 amountB);
|
||||
|
||||
function removeLiquidityETHWithPermit(
|
||||
address token,
|
||||
uint256 liquidity,
|
||||
uint256 amountTokenMin,
|
||||
uint256 amountETHMin,
|
||||
address to,
|
||||
uint256 deadline,
|
||||
bool approveMax,
|
||||
uint8 v,
|
||||
bytes32 r,
|
||||
bytes32 s
|
||||
) external returns (uint256 amountToken, uint256 amountETH);
|
||||
|
||||
function swapExactTokensForTokens(
|
||||
uint256 amountIn,
|
||||
uint256 amountOutMin,
|
||||
address[] calldata path,
|
||||
address to,
|
||||
uint256 deadline
|
||||
) external returns (uint256[] memory amounts);
|
||||
|
||||
function swapTokensForExactTokens(
|
||||
uint256 amountOut,
|
||||
uint256 amountInMax,
|
||||
address[] calldata path,
|
||||
address to,
|
||||
uint256 deadline
|
||||
) external returns (uint256[] memory amounts);
|
||||
|
||||
function swapExactETHForTokens(
|
||||
uint256 amountOutMin,
|
||||
address[] calldata path,
|
||||
address to,
|
||||
uint256 deadline
|
||||
) external payable returns (uint256[] memory amounts);
|
||||
|
||||
function swapTokensForExactETH(
|
||||
uint256 amountOut,
|
||||
uint256 amountInMax,
|
||||
address[] calldata path,
|
||||
address to,
|
||||
uint256 deadline
|
||||
) external returns (uint256[] memory amounts);
|
||||
|
||||
function swapExactTokensForETH(
|
||||
uint256 amountIn,
|
||||
uint256 amountOutMin,
|
||||
address[] calldata path,
|
||||
address to,
|
||||
uint256 deadline
|
||||
) external returns (uint256[] memory amounts);
|
||||
|
||||
function swapETHForExactTokens(
|
||||
uint256 amountOut,
|
||||
address[] calldata path,
|
||||
address to,
|
||||
uint256 deadline
|
||||
) external payable returns (uint256[] memory amounts);
|
||||
|
||||
function quote(
|
||||
uint256 amountA,
|
||||
uint256 reserveA,
|
||||
uint256 reserveB
|
||||
) external pure returns (uint256 amountB);
|
||||
|
||||
function getAmountOut(
|
||||
uint256 amountIn,
|
||||
uint256 reserveIn,
|
||||
uint256 reserveOut
|
||||
) external pure returns (uint256 amountOut);
|
||||
|
||||
function getAmountIn(
|
||||
uint256 amountOut,
|
||||
uint256 reserveIn,
|
||||
uint256 reserveOut
|
||||
) external pure returns (uint256 amountIn);
|
||||
|
||||
function getAmountsOut(uint256 amountIn, address[] calldata path)
|
||||
external
|
||||
view
|
||||
returns (uint256[] memory amounts);
|
||||
|
||||
function getAmountsIn(uint256 amountOut, address[] calldata path)
|
||||
external
|
||||
view
|
||||
returns (uint256[] memory amounts);
|
||||
}
|
50
contracts/misc/interfaces/IUniswapV2Router02.sol
Normal file
50
contracts/misc/interfaces/IUniswapV2Router02.sol
Normal file
|
@ -0,0 +1,50 @@
|
|||
pragma solidity >=0.6.2;
|
||||
|
||||
import './IUniswapV2Router01.sol';
|
||||
|
||||
interface IUniswapV2Router02 is IUniswapV2Router01 {
|
||||
function removeLiquidityETHSupportingFeeOnTransferTokens(
|
||||
address token,
|
||||
uint256 liquidity,
|
||||
uint256 amountTokenMin,
|
||||
uint256 amountETHMin,
|
||||
address to,
|
||||
uint256 deadline
|
||||
) external returns (uint256 amountETH);
|
||||
|
||||
function removeLiquidityETHWithPermitSupportingFeeOnTransferTokens(
|
||||
address token,
|
||||
uint256 liquidity,
|
||||
uint256 amountTokenMin,
|
||||
uint256 amountETHMin,
|
||||
address to,
|
||||
uint256 deadline,
|
||||
bool approveMax,
|
||||
uint8 v,
|
||||
bytes32 r,
|
||||
bytes32 s
|
||||
) external returns (uint256 amountETH);
|
||||
|
||||
function swapExactTokensForTokensSupportingFeeOnTransferTokens(
|
||||
uint256 amountIn,
|
||||
uint256 amountOutMin,
|
||||
address[] calldata path,
|
||||
address to,
|
||||
uint256 deadline
|
||||
) external;
|
||||
|
||||
function swapExactETHForTokensSupportingFeeOnTransferTokens(
|
||||
uint256 amountOutMin,
|
||||
address[] calldata path,
|
||||
address to,
|
||||
uint256 deadline
|
||||
) external payable;
|
||||
|
||||
function swapExactTokensForETHSupportingFeeOnTransferTokens(
|
||||
uint256 amountIn,
|
||||
uint256 amountOutMin,
|
||||
address[] calldata path,
|
||||
address to,
|
||||
uint256 deadline
|
||||
) external;
|
||||
}
|
|
@ -5565,7 +5565,7 @@
|
|||
}
|
||||
}
|
||||
},
|
||||
"contracts/misc/ChainlinkProxyPriceProvider.sol": {
|
||||
"contracts/misc/AaveOracle.sol": {
|
||||
"l": {
|
||||
"37": 3,
|
||||
"38": 3,
|
||||
|
@ -5591,7 +5591,7 @@
|
|||
"107": 0,
|
||||
"113": 0
|
||||
},
|
||||
"path": "/src/contracts/misc/ChainlinkProxyPriceProvider.sol",
|
||||
"path": "/src/contracts/misc/AaveOracle.sol",
|
||||
"s": {
|
||||
"1": 3,
|
||||
"2": 3,
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -10,8 +10,12 @@ services:
|
|||
command: npm run run-env
|
||||
volumes:
|
||||
- ./:/src
|
||||
- $HOME/.tenderly/config.yaml:/root/.tenderly/config.yaml
|
||||
environment:
|
||||
MNEMONIC: ${MNEMONIC}
|
||||
ETHERSCAN_KEY: ${ETHERSCAN_KEY}
|
||||
INFURA_KEY: ${INFURA_KEY}
|
||||
ETHERSCAN_NETWORK: ${ETHERSCAN_NETWORK}
|
||||
TENDERLY_PROJECT: ${TENDERLY_PROJECT}
|
||||
TENDERLY_USERNAME: ${TENDERLY_USERNAME}
|
||||
ALCHEMY_KEY: ${ALCHEMY_KEY}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import path from 'path';
|
||||
import fs from 'fs';
|
||||
import {HardhatUserConfig} from 'hardhat/config';
|
||||
import {HardhatUserConfig} from 'hardhat/types';
|
||||
// @ts-ignore
|
||||
import {accounts} from './test-wallets.js';
|
||||
import {eEthereumNetwork} from './helpers/types';
|
||||
|
@ -11,16 +11,19 @@ import '@nomiclabs/hardhat-waffle';
|
|||
import 'temp-hardhat-etherscan';
|
||||
import 'hardhat-gas-reporter';
|
||||
import 'hardhat-typechain';
|
||||
import '@tenderly/hardhat-tenderly';
|
||||
|
||||
const SKIP_LOAD = process.env.SKIP_LOAD === 'true';
|
||||
const DEFAULT_BLOCK_GAS_LIMIT = 12450000;
|
||||
const DEFAULT_GAS_MUL = 2;
|
||||
const DEFAULT_GAS_MUL = 5;
|
||||
const DEFAULT_GAS_PRICE = 2000000000;
|
||||
const HARDFORK = 'istanbul';
|
||||
const INFURA_KEY = process.env.INFURA_KEY || '';
|
||||
const ALCHEMY_KEY = process.env.ALCHEMY_KEY || '';
|
||||
const ETHERSCAN_KEY = process.env.ETHERSCAN_KEY || '';
|
||||
const MNEMONIC_PATH = "m/44'/60'/0'/0";
|
||||
const MNEMONIC = process.env.MNEMONIC || '';
|
||||
const MAINNET_FORK = process.env.MAINNET_FORK === 'true';
|
||||
|
||||
// Prevent to load scripts before compilation and typechain
|
||||
if (!SKIP_LOAD) {
|
||||
|
@ -38,7 +41,11 @@ require(`${path.join(__dirname, 'tasks/misc')}/set-bre.ts`);
|
|||
|
||||
const getCommonNetworkConfig = (networkName: eEthereumNetwork, networkId: number) => {
|
||||
return {
|
||||
url: `https://${networkName}.infura.io/v3/${INFURA_KEY}`,
|
||||
url: ALCHEMY_KEY
|
||||
? `https://eth-${
|
||||
networkName === 'main' ? 'mainnet' : networkName
|
||||
}.alchemyapi.io/v2/${ALCHEMY_KEY}`
|
||||
: `https://${networkName}.infura.io/v3/${INFURA_KEY}`,
|
||||
hardfork: HARDFORK,
|
||||
blockGasLimit: DEFAULT_BLOCK_GAS_LIMIT,
|
||||
gasMultiplier: DEFAULT_GAS_MUL,
|
||||
|
@ -53,6 +60,15 @@ const getCommonNetworkConfig = (networkName: eEthereumNetwork, networkId: number
|
|||
};
|
||||
};
|
||||
|
||||
const mainnetFork = MAINNET_FORK
|
||||
? {
|
||||
blockNumber: 11268220,
|
||||
url: ALCHEMY_KEY
|
||||
? `https://eth-mainnet.alchemyapi.io/v2/${ALCHEMY_KEY}`
|
||||
: `https://main.infura.io/v3/${INFURA_KEY}`,
|
||||
}
|
||||
: undefined;
|
||||
|
||||
const buidlerConfig: HardhatUserConfig = {
|
||||
solidity: {
|
||||
version: '0.6.8',
|
||||
|
@ -71,6 +87,11 @@ const buidlerConfig: HardhatUserConfig = {
|
|||
mocha: {
|
||||
timeout: 0,
|
||||
},
|
||||
tenderly: {
|
||||
project: process.env.TENDERLY_PROJECT || '',
|
||||
username: process.env.TENDERLY_USERNAME || '',
|
||||
forkNetwork: '1', //Network id of the network we want to fork
|
||||
},
|
||||
networks: {
|
||||
coverage: {
|
||||
url: 'http://localhost:8555',
|
||||
|
@ -79,6 +100,7 @@ const buidlerConfig: HardhatUserConfig = {
|
|||
kovan: getCommonNetworkConfig(eEthereumNetwork.kovan, 42),
|
||||
ropsten: getCommonNetworkConfig(eEthereumNetwork.ropsten, 3),
|
||||
main: getCommonNetworkConfig(eEthereumNetwork.main, 1),
|
||||
tenderlyMain: getCommonNetworkConfig(eEthereumNetwork.main, 1),
|
||||
hardhat: {
|
||||
hardfork: 'istanbul',
|
||||
blockGasLimit: DEFAULT_BLOCK_GAS_LIMIT,
|
||||
|
@ -91,6 +113,7 @@ const buidlerConfig: HardhatUserConfig = {
|
|||
privateKey: secretKey,
|
||||
balance,
|
||||
})),
|
||||
forking: mainnetFork,
|
||||
},
|
||||
buidlerevm_docker: {
|
||||
hardfork: 'istanbul',
|
||||
|
|
|
@ -3,16 +3,13 @@ import {
|
|||
iMultiPoolsAssets,
|
||||
IReserveParams,
|
||||
PoolConfiguration,
|
||||
iBasicDistributionParams,
|
||||
ICommonConfiguration,
|
||||
eEthereumNetwork,
|
||||
} from './types';
|
||||
import {getParamPerPool} from './contracts-helpers';
|
||||
import {AaveConfig} from '../config/aave';
|
||||
import {UniswapConfig} from '../config/uniswap';
|
||||
import {CommonsConfig} from '../config/commons';
|
||||
import {ZERO_ADDRESS} from './constants';
|
||||
import {DRE} from './misc-utils';
|
||||
import AaveConfig from '../markets/aave';
|
||||
import {CommonsConfig} from '../markets/aave/commons';
|
||||
import {DRE, filterMapBy} from './misc-utils';
|
||||
import {tEthereumAddress} from './types';
|
||||
import {getParamPerNetwork} from './contracts-helpers';
|
||||
import {deployWETHMocked} from './contracts-deployments';
|
||||
|
@ -27,8 +24,6 @@ export const loadPoolConfig = (configName: ConfigNames): PoolConfiguration => {
|
|||
switch (configName) {
|
||||
case ConfigNames.Aave:
|
||||
return AaveConfig;
|
||||
case ConfigNames.Uniswap:
|
||||
return UniswapConfig;
|
||||
case ConfigNames.Commons:
|
||||
return CommonsConfig;
|
||||
default:
|
||||
|
@ -46,9 +41,6 @@ export const getReservesConfigByPool = (pool: AavePools): iMultiPoolsAssets<IRes
|
|||
[AavePools.proto]: {
|
||||
...AaveConfig.ReservesConfig,
|
||||
},
|
||||
[AavePools.secondary]: {
|
||||
...UniswapConfig.ReservesConfig,
|
||||
},
|
||||
},
|
||||
pool
|
||||
);
|
||||
|
@ -100,3 +92,17 @@ export const getWethAddress = async (config: ICommonConfiguration) => {
|
|||
const weth = await deployWETHMocked();
|
||||
return weth.address;
|
||||
};
|
||||
|
||||
export const getLendingRateOracles = (poolConfig: ICommonConfiguration) => {
|
||||
const {
|
||||
ProtocolGlobalParams: {UsdAddress},
|
||||
LendingRateOracleRatesCommon,
|
||||
ReserveAssets,
|
||||
} = poolConfig;
|
||||
|
||||
const MAINNET_FORK = process.env.MAINNET_FORK === 'true';
|
||||
const network = MAINNET_FORK ? 'main' : DRE.network.name;
|
||||
return filterMapBy(LendingRateOracleRatesCommon, (key) =>
|
||||
Object.keys(ReserveAssets[network]).includes(key)
|
||||
);
|
||||
};
|
||||
|
|
|
@ -21,7 +21,7 @@ import {
|
|||
AaveProtocolDataProviderFactory,
|
||||
ATokenFactory,
|
||||
ATokensAndRatesHelperFactory,
|
||||
ChainlinkProxyPriceProviderFactory,
|
||||
AaveOracleFactory,
|
||||
DefaultReserveInterestRateStrategyFactory,
|
||||
DelegationAwareATokenFactory,
|
||||
InitializableAdminUpgradeabilityProxyFactory,
|
||||
|
@ -58,6 +58,7 @@ import {StableAndVariableTokensHelperFactory} from '../types/StableAndVariableTo
|
|||
import {MintableDelegationErc20} from '../types/MintableDelegationErc20';
|
||||
import {readArtifact as buidlerReadArtifact} from '@nomiclabs/buidler/plugins';
|
||||
import {HardhatRuntimeEnvironment} from 'hardhat/types';
|
||||
import {verifyContract} from './etherscan-verification';
|
||||
|
||||
const readArtifact = async (id: string) => {
|
||||
if (DRE.network.name === eEthereumNetwork.buidlerevm) {
|
||||
|
@ -198,13 +199,13 @@ export const deployMockAggregator = async (price: tStringTokenSmallUnits, verify
|
|||
verify
|
||||
);
|
||||
|
||||
export const deployChainlinkProxyPriceProvider = async (
|
||||
export const deployAaveOracle = async (
|
||||
args: [tEthereumAddress[], tEthereumAddress[], tEthereumAddress, tEthereumAddress],
|
||||
verify?: boolean
|
||||
) =>
|
||||
withSaveAndVerify(
|
||||
await new ChainlinkProxyPriceProviderFactory(await getFirstSigner()).deploy(...args),
|
||||
eContractid.ChainlinkProxyPriceProvider,
|
||||
await new AaveOracleFactory(await getFirstSigner()).deploy(...args),
|
||||
eContractid.AaveOracle,
|
||||
args,
|
||||
verify
|
||||
);
|
||||
|
|
|
@ -2,6 +2,7 @@ import {
|
|||
AaveProtocolDataProviderFactory,
|
||||
ATokenFactory,
|
||||
ATokensAndRatesHelperFactory,
|
||||
AaveOracleFactory,
|
||||
DefaultReserveInterestRateStrategyFactory,
|
||||
GenericLogicFactory,
|
||||
InitializableAdminUpgradeabilityProxyFactory,
|
||||
|
@ -23,12 +24,10 @@ import {
|
|||
StableDebtTokenFactory,
|
||||
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';
|
||||
|
@ -323,3 +322,9 @@ export const getLendingPoolCollateralManager = async (address?: tEthereumAddress
|
|||
|
||||
export const getAddressById = async (id: string) =>
|
||||
(await getDb().get(`${id}.${DRE.network.name}`).value()).address;
|
||||
|
||||
export const getChainlinkPriceProvider = async (address?: tEthereumAddress) =>
|
||||
await AaveOracleFactory.connect(
|
||||
address || (await getDb().get(`${eContractid.AaveOracle}.${DRE.network.name}`).value()).address,
|
||||
await getFirstSigner()
|
||||
);
|
||||
|
|
|
@ -22,7 +22,8 @@ export type MockTokenMap = {[symbol: string]: MintableERC20};
|
|||
|
||||
export const registerContractInJsonDb = async (contractId: string, contractInstance: Contract) => {
|
||||
const currentNetwork = DRE.network.name;
|
||||
if (currentNetwork !== 'hardhat' && !currentNetwork.includes('coverage')) {
|
||||
const MAINNET_FORK = process.env.MAINNET_FORK === 'true';
|
||||
if (MAINNET_FORK || (currentNetwork !== 'hardhat' && !currentNetwork.includes('coverage'))) {
|
||||
console.log(`*** ${contractId} ***\n`);
|
||||
console.log(`Network: ${currentNetwork}`);
|
||||
console.log(`tx: ${contractInstance.deployTransaction.hash}`);
|
||||
|
@ -89,6 +90,12 @@ export const withSaveAndVerify = async <ContractType extends Contract>(
|
|||
): Promise<ContractType> => {
|
||||
await waitForTx(instance.deployTransaction);
|
||||
await registerContractInJsonDb(id, instance);
|
||||
if (DRE.network.name.includes('tenderly')) {
|
||||
await (DRE as any).tenderlyRPC.verify({
|
||||
name: id,
|
||||
address: instance.address,
|
||||
});
|
||||
}
|
||||
if (verify) {
|
||||
await verifyContract(instance.address, args);
|
||||
}
|
||||
|
@ -124,9 +131,14 @@ export const linkBytecode = (artifact: BuidlerArtifact | Artifact, libraries: an
|
|||
};
|
||||
|
||||
export const getParamPerNetwork = <T>(
|
||||
{kovan, ropsten, main, buidlerevm, coverage}: iParamsPerNetwork<T>,
|
||||
{kovan, ropsten, main, buidlerevm, coverage, tenderlyMain}: iParamsPerNetwork<T>,
|
||||
network: eEthereumNetwork
|
||||
) => {
|
||||
const MAINNET_FORK = process.env.MAINNET_FORK === 'true';
|
||||
if (MAINNET_FORK) {
|
||||
return main;
|
||||
}
|
||||
|
||||
switch (network) {
|
||||
case eEthereumNetwork.coverage:
|
||||
return coverage;
|
||||
|
@ -140,15 +152,15 @@ export const getParamPerNetwork = <T>(
|
|||
return ropsten;
|
||||
case eEthereumNetwork.main:
|
||||
return main;
|
||||
case eEthereumNetwork.tenderlyMain:
|
||||
return tenderlyMain;
|
||||
}
|
||||
};
|
||||
|
||||
export const getParamPerPool = <T>({proto, secondary}: iParamsPerPool<T>, pool: AavePools) => {
|
||||
export const getParamPerPool = <T>({proto}: iParamsPerPool<T>, pool: AavePools) => {
|
||||
switch (pool) {
|
||||
case AavePools.proto:
|
||||
return proto;
|
||||
case AavePools.secondary:
|
||||
return secondary;
|
||||
default:
|
||||
return proto;
|
||||
}
|
||||
|
|
|
@ -1,17 +1,12 @@
|
|||
import {eContractid, iMultiPoolsAssets, IReserveParams, tEthereumAddress} from './types';
|
||||
import {LendingPoolConfigurator} from '../types/LendingPoolConfigurator';
|
||||
import {iMultiPoolsAssets, IReserveParams, tEthereumAddress} from './types';
|
||||
import {AaveProtocolDataProvider} from '../types/AaveProtocolDataProvider';
|
||||
import {
|
||||
deployATokensAndRatesHelper,
|
||||
deployStableAndVariableTokensHelper,
|
||||
} from './contracts-deployments';
|
||||
import {chunk, waitForTx} from './misc-utils';
|
||||
import {
|
||||
getATokensAndRatesHelper,
|
||||
getLendingPoolAddressesProvider,
|
||||
getStableAndVariableTokensHelper,
|
||||
} from './contracts-getters';
|
||||
import {insertContractAddressInDb, rawInsertContractAddressInDb} from './contracts-helpers';
|
||||
import {rawInsertContractAddressInDb} from './contracts-helpers';
|
||||
|
||||
export const initReservesByHelper = async (
|
||||
reservesParams: iMultiPoolsAssets<IReserveParams>,
|
||||
|
|
|
@ -6,6 +6,9 @@ import {WAD} from './constants';
|
|||
import {Wallet, ContractTransaction} from 'ethers';
|
||||
import {HardhatRuntimeEnvironment} from 'hardhat/types';
|
||||
import {BuidlerRuntimeEnvironment} from '@nomiclabs/buidler/types';
|
||||
import {tEthereumAddress} from './types';
|
||||
import {isAddress} from 'ethers/lib/utils';
|
||||
import {isZeroAddress} from 'ethereumjs-util';
|
||||
|
||||
export const toWad = (value: string | number) => new BigNumber(value).times(WAD).toFixed();
|
||||
|
||||
|
@ -86,3 +89,10 @@ export const printContracts = () => {
|
|||
console.log('N# Contracts:', entries.length);
|
||||
console.log(contractsPrint.join('\n'), '\n');
|
||||
};
|
||||
|
||||
export const notFalsyOrZeroAddress = (address: tEthereumAddress | null | undefined): boolean => {
|
||||
if (!address) {
|
||||
return false;
|
||||
}
|
||||
return isAddress(address) && !isZeroAddress(address);
|
||||
};
|
||||
|
|
|
@ -11,6 +11,7 @@ export enum eEthereumNetwork {
|
|||
main = 'main',
|
||||
coverage = 'coverage',
|
||||
hardhat = 'hardhat',
|
||||
tenderlyMain = 'tenderlyMain',
|
||||
}
|
||||
|
||||
export enum EthereumNetworkNames {
|
||||
|
@ -40,7 +41,7 @@ export enum eContractid {
|
|||
Proxy = 'Proxy',
|
||||
MockAggregator = 'MockAggregator',
|
||||
LendingRateOracle = 'LendingRateOracle',
|
||||
ChainlinkProxyPriceProvider = 'ChainlinkProxyPriceProvider',
|
||||
AaveOracle = 'AaveOracle',
|
||||
DefaultReserveInterestRateStrategy = 'DefaultReserveInterestRateStrategy',
|
||||
LendingPoolCollateralManager = 'LendingPoolCollateralManager',
|
||||
InitializableAdminUpgradeabilityProxy = 'InitializableAdminUpgradeabilityProxy',
|
||||
|
@ -258,7 +259,7 @@ export type iAaveSecondPoolAssets<T> = Pick<
|
|||
| 'UNI_LINK_ETH'
|
||||
>;
|
||||
|
||||
export type iMultiPoolsAssets<T> = iAssetCommon<T> | iAavePoolAssets<T> | iAaveSecondPoolAssets<T>;
|
||||
export type iMultiPoolsAssets<T> = iAssetCommon<T> | iAavePoolAssets<T>;
|
||||
|
||||
export type iAavePoolTokens<T> = Omit<iAavePoolAssets<T>, 'ETH'>;
|
||||
|
||||
|
@ -324,11 +325,11 @@ export interface iParamsPerNetwork<T> {
|
|||
[eEthereumNetwork.ropsten]: T;
|
||||
[eEthereumNetwork.main]: T;
|
||||
[eEthereumNetwork.hardhat]: T;
|
||||
[eEthereumNetwork.tenderlyMain]: T;
|
||||
}
|
||||
|
||||
export interface iParamsPerPool<T> {
|
||||
[AavePools.proto]: T;
|
||||
[AavePools.secondary]: T;
|
||||
}
|
||||
|
||||
export interface iBasicDistributionParams {
|
||||
|
@ -352,6 +353,7 @@ export enum EthereumNetwork {
|
|||
development = 'development',
|
||||
main = 'main',
|
||||
coverage = 'soliditycoverage',
|
||||
tenderlyMain = 'tenderlyMain',
|
||||
}
|
||||
|
||||
export interface IProtocolGlobalConfig {
|
||||
|
@ -389,7 +391,7 @@ export interface ICommonConfiguration {
|
|||
LendingRateOracleRatesCommon: iMultiPoolsAssets<IMarketRates>;
|
||||
LendingRateOracle: iParamsPerNetwork<tEthereumAddress>;
|
||||
TokenDistributor: iParamsPerNetwork<tEthereumAddress>;
|
||||
ChainlinkProxyPriceProvider: iParamsPerNetwork<tEthereumAddress>;
|
||||
AaveOracle: iParamsPerNetwork<tEthereumAddress>;
|
||||
FallbackOracle: iParamsPerNetwork<tEthereumAddress>;
|
||||
ChainlinkAggregator: iParamsPerNetwork<ITokenAddress>;
|
||||
PoolAdmin: iParamsPerNetwork<tEthereumAddress | undefined>;
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
import BigNumber from 'bignumber.js';
|
||||
import {zeroPad} from 'ethers/lib/utils';
|
||||
import {oneEther, oneRay, RAY, ZERO_ADDRESS} from '../helpers/constants';
|
||||
import {ICommonConfiguration, EthereumNetwork, eEthereumNetwork} from '../helpers/types';
|
||||
import {oneEther, oneRay, RAY, ZERO_ADDRESS} from '../../helpers/constants';
|
||||
import {ICommonConfiguration, EthereumNetwork, eEthereumNetwork} from '../../helpers/types';
|
||||
|
||||
const MOCK_CHAINLINK_AGGREGATORS_PRICES = {
|
||||
AAVE: oneEther.multipliedBy('0.003620948469').toFixed(),
|
||||
|
@ -141,6 +140,7 @@ export const CommonsConfig: ICommonConfiguration = {
|
|||
[eEthereumNetwork.kovan]: undefined,
|
||||
[eEthereumNetwork.ropsten]: undefined,
|
||||
[eEthereumNetwork.main]: undefined,
|
||||
[eEthereumNetwork.tenderlyMain]: undefined,
|
||||
},
|
||||
PoolAdminIndex: 0,
|
||||
EmergencyAdmin: {
|
||||
|
@ -150,6 +150,7 @@ export const CommonsConfig: ICommonConfiguration = {
|
|||
[eEthereumNetwork.kovan]: undefined,
|
||||
[eEthereumNetwork.ropsten]: undefined,
|
||||
[eEthereumNetwork.main]: undefined,
|
||||
[eEthereumNetwork.tenderlyMain]: undefined,
|
||||
},
|
||||
EmergencyAdminIndex: 1,
|
||||
ProviderRegistry: {
|
||||
|
@ -159,6 +160,7 @@ export const CommonsConfig: ICommonConfiguration = {
|
|||
[eEthereumNetwork.coverage]: '',
|
||||
[eEthereumNetwork.hardhat]: '',
|
||||
[eEthereumNetwork.buidlerevm]: '',
|
||||
[eEthereumNetwork.tenderlyMain]: '',
|
||||
},
|
||||
LendingRateOracle: {
|
||||
[eEthereumNetwork.coverage]: '',
|
||||
|
@ -166,7 +168,8 @@ export const CommonsConfig: ICommonConfiguration = {
|
|||
[eEthereumNetwork.buidlerevm]: '',
|
||||
[eEthereumNetwork.kovan]: '0xdCde9Bb6a49e37fA433990832AB541AE2d4FEB4a',
|
||||
[eEthereumNetwork.ropsten]: '0x05dcca805a6562c1bdd0423768754acb6993241b',
|
||||
[eEthereumNetwork.main]: '0x4d728a4496e4de35f218d5a214366bde3a62b51c',
|
||||
[eEthereumNetwork.main]: '',
|
||||
[eEthereumNetwork.tenderlyMain]: '',
|
||||
},
|
||||
TokenDistributor: {
|
||||
[eEthereumNetwork.coverage]: '',
|
||||
|
@ -175,14 +178,16 @@ export const CommonsConfig: ICommonConfiguration = {
|
|||
[EthereumNetwork.kovan]: '0x971efe90088f21dc6a36f610ffed77fc19710708',
|
||||
[EthereumNetwork.ropsten]: '0xeba2ea67942b8250d870b12750b594696d02fc9c',
|
||||
[EthereumNetwork.main]: '0xe3d9988f676457123c5fd01297605efdd0cba1ae',
|
||||
[EthereumNetwork.tenderlyMain]: '0xe3d9988f676457123c5fd01297605efdd0cba1ae',
|
||||
},
|
||||
ChainlinkProxyPriceProvider: {
|
||||
AaveOracle: {
|
||||
[eEthereumNetwork.coverage]: '',
|
||||
[eEthereumNetwork.hardhat]: '',
|
||||
[eEthereumNetwork.buidlerevm]: '',
|
||||
[EthereumNetwork.kovan]: '0x276C4793F2EE3D5Bf18C5b879529dD4270BA4814',
|
||||
[EthereumNetwork.ropsten]: '0x657372A559c30d236F011239fF9fbB6D76718271',
|
||||
[EthereumNetwork.main]: '0x76B47460d7F7c5222cFb6b6A75615ab10895DDe4',
|
||||
[EthereumNetwork.main]: ZERO_ADDRESS,
|
||||
[EthereumNetwork.tenderlyMain]: ZERO_ADDRESS,
|
||||
},
|
||||
FallbackOracle: {
|
||||
[eEthereumNetwork.coverage]: '',
|
||||
|
@ -190,7 +195,8 @@ export const CommonsConfig: ICommonConfiguration = {
|
|||
[eEthereumNetwork.buidlerevm]: '',
|
||||
[EthereumNetwork.kovan]: '0x50913E8E1c650E790F8a1E741FF9B1B1bB251dfe',
|
||||
[EthereumNetwork.ropsten]: '0xAD1a978cdbb8175b2eaeC47B01404f8AEC5f4F0d',
|
||||
[EthereumNetwork.main]: '0xf67a8b0e3e0ee303422f78b4c5b8da60df80a59c',
|
||||
[EthereumNetwork.main]: ZERO_ADDRESS,
|
||||
[EthereumNetwork.tenderlyMain]: ZERO_ADDRESS,
|
||||
},
|
||||
ChainlinkAggregator: {
|
||||
[eEthereumNetwork.coverage]: {},
|
||||
|
@ -283,6 +289,35 @@ export const CommonsConfig: ICommonConfiguration = {
|
|||
UNI_USDC_ETH: '0x444315Ee92F2bb3579293C17B07194227fA99bF0',
|
||||
USD: '0x59b826c214aBa7125bFA52970d97736c105Cc375',
|
||||
},
|
||||
[EthereumNetwork.tenderlyMain]: {
|
||||
AAVE: '0x6Df09E975c830ECae5bd4eD9d90f3A95a4f88012',
|
||||
BAT: '0x9b4e2579895efa2b4765063310Dc4109a7641129',
|
||||
BUSD: '0x5d4BB541EED49D0290730b4aB332aA46bd27d888',
|
||||
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_LEND_ETH: '0xF4C8Db2d999b024bBB6c6022566503eD41f2AC1E',
|
||||
UNI_LINK_ETH: '0xE2A639Beb647d7F709ca805ABa760bBEfdbE37e3',
|
||||
UNI_MKR_ETH: '0xEe40a5E8F3732bE6ECDb5A90e23D0b7bF0D4a73c',
|
||||
UNI_SETH_ETH: '0x517D40E49660c7705b2e99eEFA6d7B0E9Ba5BF10',
|
||||
UNI_USDC_ETH: '0x444315Ee92F2bb3579293C17B07194227fA99bF0',
|
||||
USD: '0x59b826c214aBa7125bFA52970d97736c105Cc375',
|
||||
},
|
||||
},
|
||||
ReserveAssets: {
|
||||
[eEthereumNetwork.coverage]: {},
|
||||
|
@ -291,6 +326,7 @@ export const CommonsConfig: ICommonConfiguration = {
|
|||
[EthereumNetwork.main]: {},
|
||||
[EthereumNetwork.kovan]: {},
|
||||
[EthereumNetwork.ropsten]: {},
|
||||
[EthereumNetwork.tenderlyMain]: {},
|
||||
},
|
||||
ReservesConfig: {},
|
||||
ATokenDomainSeparator: {
|
||||
|
@ -303,6 +339,7 @@ export const CommonsConfig: ICommonConfiguration = {
|
|||
[eEthereumNetwork.kovan]: '',
|
||||
[eEthereumNetwork.ropsten]: '',
|
||||
[eEthereumNetwork.main]: '',
|
||||
[eEthereumNetwork.tenderlyMain]: '',
|
||||
},
|
||||
ProxyPriceProvider: {
|
||||
[eEthereumNetwork.coverage]: '',
|
||||
|
@ -311,6 +348,7 @@ export const CommonsConfig: ICommonConfiguration = {
|
|||
[eEthereumNetwork.kovan]: '0xB8bE51E6563BB312Cbb2aa26e352516c25c26ac1',
|
||||
[eEthereumNetwork.ropsten]: '',
|
||||
[eEthereumNetwork.main]: '',
|
||||
[eEthereumNetwork.tenderlyMain]: '',
|
||||
},
|
||||
WETH: {
|
||||
[eEthereumNetwork.coverage]: '', // deployed in local evm
|
||||
|
@ -319,5 +357,6 @@ export const CommonsConfig: ICommonConfiguration = {
|
|||
[eEthereumNetwork.kovan]: '0xd0a1e359811322d97991e03f863a0c30c2cf029c',
|
||||
[eEthereumNetwork.ropsten]: '0xc778417e063141139fce010982780140aa0cd5ab',
|
||||
[eEthereumNetwork.main]: '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2',
|
||||
[eEthereumNetwork.tenderlyMain]: '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2',
|
||||
},
|
||||
};
|
|
@ -1,6 +1,5 @@
|
|||
import BigNumber from 'bignumber.js';
|
||||
import {oneRay, ZERO_ADDRESS} from '../helpers/constants';
|
||||
import {IAaveConfiguration, EthereumNetwork, eEthereumNetwork} from '../helpers/types';
|
||||
import {oneRay, ZERO_ADDRESS} from '../../helpers/constants';
|
||||
import {IAaveConfiguration, EthereumNetwork, eEthereumNetwork} from '../../helpers/types';
|
||||
|
||||
import {CommonsConfig} from './commons';
|
||||
import {
|
||||
|
@ -129,6 +128,29 @@ export const AaveConfig: IAaveConfiguration = {
|
|||
YFI: '0x0bc529c00C6401aEF6D220BE8C6Ea1667F6Ad93e',
|
||||
ZRX: '0xe41d2489571d322189246dafa5ebde1f4699f498',
|
||||
},
|
||||
[EthereumNetwork.tenderlyMain]: {
|
||||
AAVE: '0x7Fc66500c84A76Ad7e9c93437bFc5Ac33E2DDaE9',
|
||||
BAT: '0x0d8775f648430679a709e98d2b0cb6250d2887ef',
|
||||
BUSD: '0x4Fabb145d64652a948d72533023f6E7A623C7C53',
|
||||
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',
|
||||
},
|
||||
},
|
||||
};
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
import BigNumber from 'bignumber.js';
|
||||
import {oneRay} from '../helpers/constants';
|
||||
import {IReserveParams} from '../helpers/types';
|
||||
import {oneRay} from '../../helpers/constants';
|
||||
import {IReserveParams} from '../../helpers/types';
|
||||
|
||||
export const strategyBase: IReserveParams = {
|
||||
baseVariableBorrowRate: new BigNumber(0).multipliedBy(oneRay).toFixed(),
|
32
modules/tenderly/tenderly.d.ts
vendored
Normal file
32
modules/tenderly/tenderly.d.ts
vendored
Normal file
|
@ -0,0 +1,32 @@
|
|||
import 'hardhat/types/config';
|
||||
import 'hardhat/types/runtime';
|
||||
|
||||
import {TenderlyConfig} from './types';
|
||||
|
||||
declare module 'hardhat/types/runtime' {
|
||||
export interface HardhatRuntimeEnvironment {
|
||||
tenderly: {
|
||||
verify: (...contracts) => Promise<void>;
|
||||
push: (...contracts) => Promise<void>;
|
||||
persistArtifacts: (...contracts) => Promise<void>;
|
||||
};
|
||||
tenderlyRPC: {
|
||||
verify: (...contracts) => Promise<void>;
|
||||
resetFork: () => string | undefined;
|
||||
getHead: () => string | undefined;
|
||||
setHead: (head: string | undefined) => void;
|
||||
getFork: () => string | undefined;
|
||||
setFork: (fork: string | undefined) => void;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
declare module 'hardhat/types/config' {
|
||||
export interface HardhatUserConfig {
|
||||
tenderly?: TenderlyConfig;
|
||||
}
|
||||
|
||||
export interface HardhatConfig {
|
||||
tenderly: TenderlyConfig;
|
||||
}
|
||||
}
|
248
package-lock.json
generated
248
package-lock.json
generated
|
@ -1330,6 +1330,65 @@
|
|||
"defer-to-connect": "^1.0.1"
|
||||
}
|
||||
},
|
||||
"@tenderly/hardhat-tenderly": {
|
||||
"version": "1.1.0-beta.3",
|
||||
"resolved": "https://registry.npmjs.org/@tenderly/hardhat-tenderly/-/hardhat-tenderly-1.1.0-beta.3.tgz",
|
||||
"integrity": "sha512-CCiS3bBCc4MhOTI5oHRAuVy/Xan6/8oNnjiwbsRvG1hdUis+EL/UVwn5yrUM1qXQTPz/La3TvRkfEa/pq1gimw==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"axios": "^0.20.0",
|
||||
"fs-extra": "^9.0.1",
|
||||
"js-yaml": "^3.14.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"fs-extra": {
|
||||
"version": "9.0.1",
|
||||
"resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-9.0.1.tgz",
|
||||
"integrity": "sha512-h2iAoN838FqAFJY2/qVpzFXy+EBxfVE220PalAqQLDVsFOHLJrZvut5puAbCdNv6WJk+B8ihI+k0c7JK5erwqQ==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"at-least-node": "^1.0.0",
|
||||
"graceful-fs": "^4.2.0",
|
||||
"jsonfile": "^6.0.1",
|
||||
"universalify": "^1.0.0"
|
||||
}
|
||||
},
|
||||
"js-yaml": {
|
||||
"version": "3.14.0",
|
||||
"resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.0.tgz",
|
||||
"integrity": "sha512-/4IbIeHcD9VMHFqDR/gQ7EdZdLimOvW2DdcxFjdyyZ9NsbS+ccrXqVWDtab/lRl5AlUqmpBx8EhPaWR+OtY17A==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"argparse": "^1.0.7",
|
||||
"esprima": "^4.0.0"
|
||||
}
|
||||
},
|
||||
"jsonfile": {
|
||||
"version": "6.1.0",
|
||||
"resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz",
|
||||
"integrity": "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"graceful-fs": "^4.1.6",
|
||||
"universalify": "^2.0.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"universalify": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.0.tgz",
|
||||
"integrity": "sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ==",
|
||||
"dev": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"universalify": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/universalify/-/universalify-1.0.0.tgz",
|
||||
"integrity": "sha512-rb6X1W158d7pRQBg5gkR8uPaSfiids68LTJQYOtEUhoJUWBdaQHsuT/EUduxXYxcrt4r5PJ4fuHW1MHT6p0qug==",
|
||||
"dev": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"@truffle/error": {
|
||||
"version": "0.0.7",
|
||||
"resolved": "https://registry.npmjs.org/@truffle/error/-/error-0.0.7.tgz",
|
||||
|
@ -2482,6 +2541,12 @@
|
|||
"integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=",
|
||||
"dev": true
|
||||
},
|
||||
"at-least-node": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/at-least-node/-/at-least-node-1.0.0.tgz",
|
||||
"integrity": "sha512-+q/t7Ekv1EDY2l6Gda6LLiX14rU9TV20Wa3ofeQmwPFZbOMo9DXrLbOjFaaclkXKWidIaopwAObQDqwWtGUjqg==",
|
||||
"dev": true
|
||||
},
|
||||
"aws-sign2": {
|
||||
"version": "0.7.0",
|
||||
"resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz",
|
||||
|
@ -2494,6 +2559,15 @@
|
|||
"integrity": "sha512-3YDiu347mtVtjpyV3u5kVqQLP242c06zwDOgpeRnybmXlYYsLbtTrUBUm8i8srONt+FWobl5aibnU1030PeeuA==",
|
||||
"dev": true
|
||||
},
|
||||
"axios": {
|
||||
"version": "0.20.0",
|
||||
"resolved": "https://registry.npmjs.org/axios/-/axios-0.20.0.tgz",
|
||||
"integrity": "sha512-ANA4rr2BDcmmAQLOKft2fufrtuvlqR+cXNNinUmvfeSNCOF98PZL+7M/v1zIdGo7OLjEA9J2gXJL+j4zGsl0bA==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"follow-redirects": "^1.10.0"
|
||||
}
|
||||
},
|
||||
"balanced-match": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz",
|
||||
|
@ -5293,13 +5367,13 @@
|
|||
"dependencies": {
|
||||
"ansi-regex": {
|
||||
"version": "4.1.0",
|
||||
"resolved": false,
|
||||
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz",
|
||||
"integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==",
|
||||
"dev": true
|
||||
},
|
||||
"ansi-styles": {
|
||||
"version": "3.2.1",
|
||||
"resolved": false,
|
||||
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz",
|
||||
"integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
|
@ -5308,7 +5382,7 @@
|
|||
},
|
||||
"bindings": {
|
||||
"version": "1.5.0",
|
||||
"resolved": false,
|
||||
"resolved": "https://registry.npmjs.org/bindings/-/bindings-1.5.0.tgz",
|
||||
"integrity": "sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
|
@ -5317,7 +5391,7 @@
|
|||
},
|
||||
"bip66": {
|
||||
"version": "1.1.5",
|
||||
"resolved": false,
|
||||
"resolved": "https://registry.npmjs.org/bip66/-/bip66-1.1.5.tgz",
|
||||
"integrity": "sha1-AfqHSHhcpwlV1QESF9GzE5lpyiI=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
|
@ -5326,19 +5400,19 @@
|
|||
},
|
||||
"bn.js": {
|
||||
"version": "4.11.8",
|
||||
"resolved": false,
|
||||
"resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.8.tgz",
|
||||
"integrity": "sha512-ItfYfPLkWHUjckQCk8xC+LwxgK8NYcXywGigJgSwOP8Y2iyWT4f2vsZnoOXTTbo+o5yXmIUJ4gn5538SO5S3gA==",
|
||||
"dev": true
|
||||
},
|
||||
"brorand": {
|
||||
"version": "1.1.0",
|
||||
"resolved": false,
|
||||
"resolved": "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz",
|
||||
"integrity": "sha1-EsJe/kCkXjwyPrhnWgoM5XsiNx8=",
|
||||
"dev": true
|
||||
},
|
||||
"browserify-aes": {
|
||||
"version": "1.2.0",
|
||||
"resolved": false,
|
||||
"resolved": "https://registry.npmjs.org/browserify-aes/-/browserify-aes-1.2.0.tgz",
|
||||
"integrity": "sha512-+7CHXqGuspUn/Sl5aO7Ea0xWGAtETPXNSAjHo48JfLdPWcMng33Xe4znFvQweqc/uzk5zSOI3H52CYnjCfb5hA==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
|
@ -5352,25 +5426,25 @@
|
|||
},
|
||||
"buffer-from": {
|
||||
"version": "1.1.1",
|
||||
"resolved": false,
|
||||
"resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz",
|
||||
"integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==",
|
||||
"dev": true
|
||||
},
|
||||
"buffer-xor": {
|
||||
"version": "1.0.3",
|
||||
"resolved": false,
|
||||
"resolved": "https://registry.npmjs.org/buffer-xor/-/buffer-xor-1.0.3.tgz",
|
||||
"integrity": "sha1-JuYe0UIvtw3ULm42cp7VHYVf6Nk=",
|
||||
"dev": true
|
||||
},
|
||||
"camelcase": {
|
||||
"version": "5.3.1",
|
||||
"resolved": false,
|
||||
"resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz",
|
||||
"integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==",
|
||||
"dev": true
|
||||
},
|
||||
"cipher-base": {
|
||||
"version": "1.0.4",
|
||||
"resolved": false,
|
||||
"resolved": "https://registry.npmjs.org/cipher-base/-/cipher-base-1.0.4.tgz",
|
||||
"integrity": "sha512-Kkht5ye6ZGmwv40uUDZztayT2ThLQGfnj/T71N/XzeZeo3nf8foyW7zGTsPYkEya3m5f3cAypH+qe7YOrM1U2Q==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
|
@ -5380,7 +5454,7 @@
|
|||
},
|
||||
"cliui": {
|
||||
"version": "5.0.0",
|
||||
"resolved": false,
|
||||
"resolved": "https://registry.npmjs.org/cliui/-/cliui-5.0.0.tgz",
|
||||
"integrity": "sha512-PYeGSEmmHM6zvoef2w8TPzlrnNpXIjTipYK780YswmIP9vjxmd6Y2a3CB2Ks6/AU8NHjZugXvo8w3oWM2qnwXA==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
|
@ -5391,7 +5465,7 @@
|
|||
},
|
||||
"color-convert": {
|
||||
"version": "1.9.3",
|
||||
"resolved": false,
|
||||
"resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz",
|
||||
"integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
|
@ -5400,13 +5474,13 @@
|
|||
},
|
||||
"color-name": {
|
||||
"version": "1.1.3",
|
||||
"resolved": false,
|
||||
"resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz",
|
||||
"integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=",
|
||||
"dev": true
|
||||
},
|
||||
"create-hash": {
|
||||
"version": "1.2.0",
|
||||
"resolved": false,
|
||||
"resolved": "https://registry.npmjs.org/create-hash/-/create-hash-1.2.0.tgz",
|
||||
"integrity": "sha512-z00bCGNHDG8mHAkP7CtT1qVu+bFQUPjYq/4Iv3C3kWjTFV10zIjfSoeqXo9Asws8gwSHDGj/hl2u4OGIjapeCg==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
|
@ -5419,7 +5493,7 @@
|
|||
},
|
||||
"create-hmac": {
|
||||
"version": "1.1.7",
|
||||
"resolved": false,
|
||||
"resolved": "https://registry.npmjs.org/create-hmac/-/create-hmac-1.1.7.tgz",
|
||||
"integrity": "sha512-MJG9liiZ+ogc4TzUwuvbER1JRdgvUFSB5+VR/g5h82fGaIRWMWddtKBHi7/sVhfjQZ6SehlyhvQYrcYkaUIpLg==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
|
@ -5433,7 +5507,7 @@
|
|||
},
|
||||
"cross-spawn": {
|
||||
"version": "6.0.5",
|
||||
"resolved": false,
|
||||
"resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz",
|
||||
"integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
|
@ -5446,13 +5520,13 @@
|
|||
},
|
||||
"decamelize": {
|
||||
"version": "1.2.0",
|
||||
"resolved": false,
|
||||
"resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz",
|
||||
"integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=",
|
||||
"dev": true
|
||||
},
|
||||
"drbg.js": {
|
||||
"version": "1.0.1",
|
||||
"resolved": false,
|
||||
"resolved": "https://registry.npmjs.org/drbg.js/-/drbg.js-1.0.1.tgz",
|
||||
"integrity": "sha1-Pja2xCs3BDgjzbwzLVjzHiRFSAs=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
|
@ -5463,7 +5537,7 @@
|
|||
},
|
||||
"elliptic": {
|
||||
"version": "6.5.0",
|
||||
"resolved": false,
|
||||
"resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.0.tgz",
|
||||
"integrity": "sha512-eFOJTMyCYb7xtE/caJ6JJu+bhi67WCYNbkGSknu20pmM8Ke/bqOfdnZWxyoGN26JgfxTbXrsCkEw4KheCT/KGg==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
|
@ -5478,13 +5552,13 @@
|
|||
},
|
||||
"emoji-regex": {
|
||||
"version": "7.0.3",
|
||||
"resolved": false,
|
||||
"resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz",
|
||||
"integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==",
|
||||
"dev": true
|
||||
},
|
||||
"end-of-stream": {
|
||||
"version": "1.4.1",
|
||||
"resolved": false,
|
||||
"resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.1.tgz",
|
||||
"integrity": "sha512-1MkrZNvWTKCaigbn+W15elq2BB/L22nqrSY5DKlo3X6+vclJm8Bb5djXJBmEX6fS3+zCh/F4VBK5Z2KxJt4s2Q==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
|
@ -5493,7 +5567,7 @@
|
|||
},
|
||||
"ethereumjs-util": {
|
||||
"version": "6.1.0",
|
||||
"resolved": false,
|
||||
"resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-6.1.0.tgz",
|
||||
"integrity": "sha512-URESKMFbDeJxnAxPppnk2fN6Y3BIatn9fwn76Lm8bQlt+s52TpG8dN9M66MLPuRAiAOIqL3dfwqWJf0sd0fL0Q==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
|
@ -5508,7 +5582,7 @@
|
|||
},
|
||||
"ethjs-util": {
|
||||
"version": "0.1.6",
|
||||
"resolved": false,
|
||||
"resolved": "https://registry.npmjs.org/ethjs-util/-/ethjs-util-0.1.6.tgz",
|
||||
"integrity": "sha512-CUnVOQq7gSpDHZVVrQW8ExxUETWrnrvXYvYz55wOU8Uj4VCgw56XC2B/fVqQN+f7gmrnRHSLVnFAwsCuNwji8w==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
|
@ -5518,7 +5592,7 @@
|
|||
},
|
||||
"evp_bytestokey": {
|
||||
"version": "1.0.3",
|
||||
"resolved": false,
|
||||
"resolved": "https://registry.npmjs.org/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz",
|
||||
"integrity": "sha512-/f2Go4TognH/KvCISP7OUsHn85hT9nUkxxA9BEWxFn+Oj9o8ZNLm/40hdlgSLyuOimsrTKLUMEorQexp/aPQeA==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
|
@ -5528,7 +5602,7 @@
|
|||
},
|
||||
"execa": {
|
||||
"version": "1.0.0",
|
||||
"resolved": false,
|
||||
"resolved": "https://registry.npmjs.org/execa/-/execa-1.0.0.tgz",
|
||||
"integrity": "sha512-adbxcyWV46qiHyvSp50TKt05tB4tK3HcmF7/nxfAdhnox83seTDbwnaqKO4sXRy7roHAIFqJP/Rw/AuEbX61LA==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
|
@ -5543,13 +5617,13 @@
|
|||
},
|
||||
"file-uri-to-path": {
|
||||
"version": "1.0.0",
|
||||
"resolved": false,
|
||||
"resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz",
|
||||
"integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==",
|
||||
"dev": true
|
||||
},
|
||||
"find-up": {
|
||||
"version": "3.0.0",
|
||||
"resolved": false,
|
||||
"resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz",
|
||||
"integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
|
@ -5558,13 +5632,13 @@
|
|||
},
|
||||
"get-caller-file": {
|
||||
"version": "2.0.5",
|
||||
"resolved": false,
|
||||
"resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz",
|
||||
"integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==",
|
||||
"dev": true
|
||||
},
|
||||
"get-stream": {
|
||||
"version": "4.1.0",
|
||||
"resolved": false,
|
||||
"resolved": "https://registry.npmjs.org/get-stream/-/get-stream-4.1.0.tgz",
|
||||
"integrity": "sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
|
@ -5573,7 +5647,7 @@
|
|||
},
|
||||
"hash-base": {
|
||||
"version": "3.0.4",
|
||||
"resolved": false,
|
||||
"resolved": "https://registry.npmjs.org/hash-base/-/hash-base-3.0.4.tgz",
|
||||
"integrity": "sha1-X8hoaEfs1zSZQDMZprCj8/auSRg=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
|
@ -5583,7 +5657,7 @@
|
|||
},
|
||||
"hash.js": {
|
||||
"version": "1.1.7",
|
||||
"resolved": false,
|
||||
"resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.7.tgz",
|
||||
"integrity": "sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
|
@ -5593,7 +5667,7 @@
|
|||
},
|
||||
"hmac-drbg": {
|
||||
"version": "1.0.1",
|
||||
"resolved": false,
|
||||
"resolved": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz",
|
||||
"integrity": "sha1-0nRXAQJabHdabFRXk+1QL8DGSaE=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
|
@ -5604,43 +5678,43 @@
|
|||
},
|
||||
"inherits": {
|
||||
"version": "2.0.4",
|
||||
"resolved": false,
|
||||
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz",
|
||||
"integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==",
|
||||
"dev": true
|
||||
},
|
||||
"invert-kv": {
|
||||
"version": "2.0.0",
|
||||
"resolved": false,
|
||||
"resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-2.0.0.tgz",
|
||||
"integrity": "sha512-wPVv/y/QQ/Uiirj/vh3oP+1Ww+AWehmi1g5fFWGPF6IpCBCDVrhgHRMvrLfdYcwDh3QJbGXDW4JAuzxElLSqKA==",
|
||||
"dev": true
|
||||
},
|
||||
"is-fullwidth-code-point": {
|
||||
"version": "2.0.0",
|
||||
"resolved": false,
|
||||
"resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz",
|
||||
"integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=",
|
||||
"dev": true
|
||||
},
|
||||
"is-hex-prefixed": {
|
||||
"version": "1.0.0",
|
||||
"resolved": false,
|
||||
"resolved": "https://registry.npmjs.org/is-hex-prefixed/-/is-hex-prefixed-1.0.0.tgz",
|
||||
"integrity": "sha1-fY035q135dEnFIkTxXPggtd39VQ=",
|
||||
"dev": true
|
||||
},
|
||||
"is-stream": {
|
||||
"version": "1.1.0",
|
||||
"resolved": false,
|
||||
"resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz",
|
||||
"integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=",
|
||||
"dev": true
|
||||
},
|
||||
"isexe": {
|
||||
"version": "2.0.0",
|
||||
"resolved": false,
|
||||
"resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz",
|
||||
"integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=",
|
||||
"dev": true
|
||||
},
|
||||
"keccak": {
|
||||
"version": "1.4.0",
|
||||
"resolved": false,
|
||||
"resolved": "https://registry.npmjs.org/keccak/-/keccak-1.4.0.tgz",
|
||||
"integrity": "sha512-eZVaCpblK5formjPjeTBik7TAg+pqnDrMHIffSvi9Lh7PQgM1+hSzakUeZFCk9DVVG0dacZJuaz2ntwlzZUIBw==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
|
@ -5652,7 +5726,7 @@
|
|||
},
|
||||
"lcid": {
|
||||
"version": "2.0.0",
|
||||
"resolved": false,
|
||||
"resolved": "https://registry.npmjs.org/lcid/-/lcid-2.0.0.tgz",
|
||||
"integrity": "sha512-avPEb8P8EGnwXKClwsNUgryVjllcRqtMYa49NTsbQagYuT1DcXnl1915oxWjoyGrXR6zH/Y0Zc96xWsPcoDKeA==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
|
@ -5661,7 +5735,7 @@
|
|||
},
|
||||
"locate-path": {
|
||||
"version": "3.0.0",
|
||||
"resolved": false,
|
||||
"resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz",
|
||||
"integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
|
@ -5671,7 +5745,7 @@
|
|||
},
|
||||
"map-age-cleaner": {
|
||||
"version": "0.1.3",
|
||||
"resolved": false,
|
||||
"resolved": "https://registry.npmjs.org/map-age-cleaner/-/map-age-cleaner-0.1.3.tgz",
|
||||
"integrity": "sha512-bJzx6nMoP6PDLPBFmg7+xRKeFZvFboMrGlxmNj9ClvX53KrmvM5bXFXEWjbz4cz1AFn+jWJ9z/DJSz7hrs0w3w==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
|
@ -5680,7 +5754,7 @@
|
|||
},
|
||||
"md5.js": {
|
||||
"version": "1.3.5",
|
||||
"resolved": false,
|
||||
"resolved": "https://registry.npmjs.org/md5.js/-/md5.js-1.3.5.tgz",
|
||||
"integrity": "sha512-xitP+WxNPcTTOgnTJcrhM0xvdPepipPSf3I8EIpGKeFLjt3PlJLIDG3u8EX53ZIubkb+5U2+3rELYpEhHhzdkg==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
|
@ -5691,7 +5765,7 @@
|
|||
},
|
||||
"mem": {
|
||||
"version": "4.3.0",
|
||||
"resolved": false,
|
||||
"resolved": "https://registry.npmjs.org/mem/-/mem-4.3.0.tgz",
|
||||
"integrity": "sha512-qX2bG48pTqYRVmDB37rn/6PT7LcR8T7oAX3bf99u1Tt1nzxYfxkgqDwUwolPlXweM0XzBOBFzSx4kfp7KP1s/w==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
|
@ -5702,37 +5776,37 @@
|
|||
},
|
||||
"mimic-fn": {
|
||||
"version": "2.1.0",
|
||||
"resolved": false,
|
||||
"resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz",
|
||||
"integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==",
|
||||
"dev": true
|
||||
},
|
||||
"minimalistic-assert": {
|
||||
"version": "1.0.1",
|
||||
"resolved": false,
|
||||
"resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz",
|
||||
"integrity": "sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A==",
|
||||
"dev": true
|
||||
},
|
||||
"minimalistic-crypto-utils": {
|
||||
"version": "1.0.1",
|
||||
"resolved": false,
|
||||
"resolved": "https://registry.npmjs.org/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz",
|
||||
"integrity": "sha1-9sAMHAsIIkblxNmd+4x8CDsrWCo=",
|
||||
"dev": true
|
||||
},
|
||||
"nan": {
|
||||
"version": "2.14.0",
|
||||
"resolved": false,
|
||||
"resolved": "https://registry.npmjs.org/nan/-/nan-2.14.0.tgz",
|
||||
"integrity": "sha512-INOFj37C7k3AfaNTtX8RhsTw7qRy7eLET14cROi9+5HAVbbHuIWUHEauBv5qT4Av2tWasiTY1Jw6puUNqRJXQg==",
|
||||
"dev": true
|
||||
},
|
||||
"nice-try": {
|
||||
"version": "1.0.5",
|
||||
"resolved": false,
|
||||
"resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz",
|
||||
"integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==",
|
||||
"dev": true
|
||||
},
|
||||
"npm-run-path": {
|
||||
"version": "2.0.2",
|
||||
"resolved": false,
|
||||
"resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-2.0.2.tgz",
|
||||
"integrity": "sha1-NakjLfo11wZ7TLLd8jV7GHFTbF8=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
|
@ -5741,7 +5815,7 @@
|
|||
},
|
||||
"once": {
|
||||
"version": "1.4.0",
|
||||
"resolved": false,
|
||||
"resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz",
|
||||
"integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
|
@ -5750,7 +5824,7 @@
|
|||
},
|
||||
"os-locale": {
|
||||
"version": "3.1.0",
|
||||
"resolved": false,
|
||||
"resolved": "https://registry.npmjs.org/os-locale/-/os-locale-3.1.0.tgz",
|
||||
"integrity": "sha512-Z8l3R4wYWM40/52Z+S265okfFj8Kt2cC2MKY+xNi3kFs+XGI7WXu/I309QQQYbRW4ijiZ+yxs9pqEhJh0DqW3Q==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
|
@ -5761,25 +5835,25 @@
|
|||
},
|
||||
"p-defer": {
|
||||
"version": "1.0.0",
|
||||
"resolved": false,
|
||||
"resolved": "https://registry.npmjs.org/p-defer/-/p-defer-1.0.0.tgz",
|
||||
"integrity": "sha1-n26xgvbJqozXQwBKfU+WsZaw+ww=",
|
||||
"dev": true
|
||||
},
|
||||
"p-finally": {
|
||||
"version": "1.0.0",
|
||||
"resolved": false,
|
||||
"resolved": "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz",
|
||||
"integrity": "sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4=",
|
||||
"dev": true
|
||||
},
|
||||
"p-is-promise": {
|
||||
"version": "2.1.0",
|
||||
"resolved": false,
|
||||
"resolved": "https://registry.npmjs.org/p-is-promise/-/p-is-promise-2.1.0.tgz",
|
||||
"integrity": "sha512-Y3W0wlRPK8ZMRbNq97l4M5otioeA5lm1z7bkNkxCka8HSPjR0xRWmpCmc9utiaLP9Jb1eD8BgeIxTW4AIF45Pg==",
|
||||
"dev": true
|
||||
},
|
||||
"p-limit": {
|
||||
"version": "2.2.0",
|
||||
"resolved": false,
|
||||
"resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.2.0.tgz",
|
||||
"integrity": "sha512-pZbTJpoUsCzV48Mc9Nh51VbwO0X9cuPFE8gYwx9BTCt9SF8/b7Zljd2fVgOxhIF/HDTKgpVzs+GPhyKfjLLFRQ==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
|
@ -5788,7 +5862,7 @@
|
|||
},
|
||||
"p-locate": {
|
||||
"version": "3.0.0",
|
||||
"resolved": false,
|
||||
"resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz",
|
||||
"integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
|
@ -5797,25 +5871,25 @@
|
|||
},
|
||||
"p-try": {
|
||||
"version": "2.2.0",
|
||||
"resolved": false,
|
||||
"resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz",
|
||||
"integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==",
|
||||
"dev": true
|
||||
},
|
||||
"path-exists": {
|
||||
"version": "3.0.0",
|
||||
"resolved": false,
|
||||
"resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz",
|
||||
"integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=",
|
||||
"dev": true
|
||||
},
|
||||
"path-key": {
|
||||
"version": "2.0.1",
|
||||
"resolved": false,
|
||||
"resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz",
|
||||
"integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=",
|
||||
"dev": true
|
||||
},
|
||||
"pump": {
|
||||
"version": "3.0.0",
|
||||
"resolved": false,
|
||||
"resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz",
|
||||
"integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
|
@ -5825,19 +5899,19 @@
|
|||
},
|
||||
"require-directory": {
|
||||
"version": "2.1.1",
|
||||
"resolved": false,
|
||||
"resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz",
|
||||
"integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=",
|
||||
"dev": true
|
||||
},
|
||||
"require-main-filename": {
|
||||
"version": "2.0.0",
|
||||
"resolved": false,
|
||||
"resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz",
|
||||
"integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==",
|
||||
"dev": true
|
||||
},
|
||||
"ripemd160": {
|
||||
"version": "2.0.2",
|
||||
"resolved": false,
|
||||
"resolved": "https://registry.npmjs.org/ripemd160/-/ripemd160-2.0.2.tgz",
|
||||
"integrity": "sha512-ii4iagi25WusVoiC4B4lq7pbXfAp3D9v5CwfkY33vffw2+pkDjY1D8GaN7spsxvCSx8dkPqOZCEZyfxcmJG2IA==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
|
@ -5847,7 +5921,7 @@
|
|||
},
|
||||
"rlp": {
|
||||
"version": "2.2.3",
|
||||
"resolved": false,
|
||||
"resolved": "https://registry.npmjs.org/rlp/-/rlp-2.2.3.tgz",
|
||||
"integrity": "sha512-l6YVrI7+d2vpW6D6rS05x2Xrmq8oW7v3pieZOJKBEdjuTF4Kz/iwk55Zyh1Zaz+KOB2kC8+2jZlp2u9L4tTzCQ==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
|
@ -5857,13 +5931,13 @@
|
|||
},
|
||||
"safe-buffer": {
|
||||
"version": "5.2.0",
|
||||
"resolved": false,
|
||||
"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.0.tgz",
|
||||
"integrity": "sha512-fZEwUGbVl7kouZs1jCdMLdt95hdIv0ZeHg6L7qPeciMZhZ+/gdesW4wgTARkrFWEpspjEATAzUGPG8N2jJiwbg==",
|
||||
"dev": true
|
||||
},
|
||||
"secp256k1": {
|
||||
"version": "3.7.1",
|
||||
"resolved": false,
|
||||
"resolved": "https://registry.npmjs.org/secp256k1/-/secp256k1-3.7.1.tgz",
|
||||
"integrity": "sha512-1cf8sbnRreXrQFdH6qsg2H71Xw91fCCS9Yp021GnUNJzWJS/py96fS4lHbnTnouLp08Xj6jBoBB6V78Tdbdu5g==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
|
@ -5879,19 +5953,19 @@
|
|||
},
|
||||
"semver": {
|
||||
"version": "5.7.0",
|
||||
"resolved": false,
|
||||
"resolved": "https://registry.npmjs.org/semver/-/semver-5.7.0.tgz",
|
||||
"integrity": "sha512-Ya52jSX2u7QKghxeoFGpLwCtGlt7j0oY9DYb5apt9nPlJ42ID+ulTXESnt/qAQcoSERyZ5sl3LDIOw0nAn/5DA==",
|
||||
"dev": true
|
||||
},
|
||||
"set-blocking": {
|
||||
"version": "2.0.0",
|
||||
"resolved": false,
|
||||
"resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz",
|
||||
"integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=",
|
||||
"dev": true
|
||||
},
|
||||
"sha.js": {
|
||||
"version": "2.4.11",
|
||||
"resolved": false,
|
||||
"resolved": "https://registry.npmjs.org/sha.js/-/sha.js-2.4.11.tgz",
|
||||
"integrity": "sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
|
@ -5901,7 +5975,7 @@
|
|||
},
|
||||
"shebang-command": {
|
||||
"version": "1.2.0",
|
||||
"resolved": false,
|
||||
"resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz",
|
||||
"integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
|
@ -5910,25 +5984,25 @@
|
|||
},
|
||||
"shebang-regex": {
|
||||
"version": "1.0.0",
|
||||
"resolved": false,
|
||||
"resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz",
|
||||
"integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=",
|
||||
"dev": true
|
||||
},
|
||||
"signal-exit": {
|
||||
"version": "3.0.2",
|
||||
"resolved": false,
|
||||
"resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz",
|
||||
"integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=",
|
||||
"dev": true
|
||||
},
|
||||
"source-map": {
|
||||
"version": "0.6.1",
|
||||
"resolved": false,
|
||||
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
|
||||
"integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
|
||||
"dev": true
|
||||
},
|
||||
"source-map-support": {
|
||||
"version": "0.5.12",
|
||||
"resolved": false,
|
||||
"resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.12.tgz",
|
||||
"integrity": "sha512-4h2Pbvyy15EE02G+JOZpUCmqWJuqrs+sEkzewTm++BPi7Hvn/HwcqLAcNxYAyI0x13CpPPn+kMjl+hplXMHITQ==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
|
@ -5938,7 +6012,7 @@
|
|||
},
|
||||
"string-width": {
|
||||
"version": "3.1.0",
|
||||
"resolved": false,
|
||||
"resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz",
|
||||
"integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
|
@ -5949,7 +6023,7 @@
|
|||
},
|
||||
"strip-ansi": {
|
||||
"version": "5.2.0",
|
||||
"resolved": false,
|
||||
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz",
|
||||
"integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
|
@ -5958,13 +6032,13 @@
|
|||
},
|
||||
"strip-eof": {
|
||||
"version": "1.0.0",
|
||||
"resolved": false,
|
||||
"resolved": "https://registry.npmjs.org/strip-eof/-/strip-eof-1.0.0.tgz",
|
||||
"integrity": "sha1-u0P/VZim6wXYm1n80SnJgzE2Br8=",
|
||||
"dev": true
|
||||
},
|
||||
"strip-hex-prefix": {
|
||||
"version": "1.0.0",
|
||||
"resolved": false,
|
||||
"resolved": "https://registry.npmjs.org/strip-hex-prefix/-/strip-hex-prefix-1.0.0.tgz",
|
||||
"integrity": "sha1-DF8VX+8RUTczd96du1iNoFUA428=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
|
@ -5973,7 +6047,7 @@
|
|||
},
|
||||
"which": {
|
||||
"version": "1.3.1",
|
||||
"resolved": false,
|
||||
"resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz",
|
||||
"integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
|
@ -5982,13 +6056,13 @@
|
|||
},
|
||||
"which-module": {
|
||||
"version": "2.0.0",
|
||||
"resolved": false,
|
||||
"resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz",
|
||||
"integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=",
|
||||
"dev": true
|
||||
},
|
||||
"wrap-ansi": {
|
||||
"version": "5.1.0",
|
||||
"resolved": false,
|
||||
"resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-5.1.0.tgz",
|
||||
"integrity": "sha512-QC1/iN/2/RPVJ5jYK8BGttj5z83LmSKmvbvrXPNCLZSEb32KKVDJDl/MOt2N01qU2H/FkzEa9PKto1BqDjtd7Q==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
|
@ -5999,19 +6073,19 @@
|
|||
},
|
||||
"wrappy": {
|
||||
"version": "1.0.2",
|
||||
"resolved": false,
|
||||
"resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
|
||||
"integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=",
|
||||
"dev": true
|
||||
},
|
||||
"y18n": {
|
||||
"version": "4.0.0",
|
||||
"resolved": false,
|
||||
"resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.0.tgz",
|
||||
"integrity": "sha512-r9S/ZyXu/Xu9q1tYlpsLIsa3EeLXXk0VwlxqTcFRfg9EhMW+17kbt9G0NrgCmhGb5vT2hyhJZLfDGx+7+5Uj/w==",
|
||||
"dev": true
|
||||
},
|
||||
"yargs": {
|
||||
"version": "13.2.4",
|
||||
"resolved": false,
|
||||
"resolved": "https://registry.npmjs.org/yargs/-/yargs-13.2.4.tgz",
|
||||
"integrity": "sha512-HG/DWAJa1PAnHT9JAhNa8AbAv3FPaiLzioSjCcmuXXhP8MlpHO5vwls4g4j6n30Z74GVQj8Xa62dWVx1QCGklg==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
|
@ -6030,7 +6104,7 @@
|
|||
},
|
||||
"yargs-parser": {
|
||||
"version": "13.1.1",
|
||||
"resolved": false,
|
||||
"resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-13.1.1.tgz",
|
||||
"integrity": "sha512-oVAVsHz6uFrg3XQheFII8ESO2ssAf9luWuAd6Wexsu4F3OtIW0o8IribPXYrD4WC24LWtPrJlGy87y5udK+dxQ==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
|
|
38
package.json
38
package.json
|
@ -6,31 +6,13 @@
|
|||
"run-env": "npm i && tail -f /dev/null",
|
||||
"hardhat": "hardhat",
|
||||
"hardhat:kovan": "hardhat --network kovan",
|
||||
"hardhat:tenderly-main": "hardhat --network tenderlyMain",
|
||||
"hardhat:ropsten": "hardhat--network ropsten",
|
||||
"hardhat:main": "hardhat --network main",
|
||||
"hardhat:docker": "hardhat --network hardhatevm_docker",
|
||||
"compile": "SKIP_LOAD=true hardhat compile",
|
||||
"test": "SKIP_LOAD=true TS_NODE_TRANSPILE_ONLY=1 hardhat test",
|
||||
"test": "TS_NODE_TRANSPILE_ONLY=1 hardhat test ./test/*.spec.ts",
|
||||
"test-scenarios": "npm run test -- test/__setup.spec.ts test/scenario.spec.ts",
|
||||
"aave:evm:dev:migration": "hardhat aave:dev",
|
||||
"aave:evm:full:migration": "hardhat aave:full",
|
||||
"aave:docker:dev:migration": "npm run hardhat:docker -- aave:dev",
|
||||
"aave:docker:full:migration": "npm run hardhat:docker -- aave:full",
|
||||
"aave:kovan:dev:migration": "npm run hardhat:kovan -- aave:dev --verify",
|
||||
"aave:kovan:full:migration": "npm run hardhat:kovan -- aave:full --verify",
|
||||
"aave:kovan:full:initialize": "npm run hardhat:kovan -- full:initialize-lending-pool --verify --pool Aave",
|
||||
"aave:ropsten:dev:migration": "npm run hardhat:ropsten -- aave:dev --verify",
|
||||
"aave:ropsten:full:migration": "npm run hardhat:ropsten -- aave:full --verify",
|
||||
"aave:main:dev:migration": "npm run hardhat:main -- aave:dev --verify",
|
||||
"aave:main:full:migration": "npm run hardhat:main -- aave:full --verify",
|
||||
"uniswap:evm:dev:migration": "hardhat uniswap:dev",
|
||||
"uniswap:evm:full:migration": "hardhat uniswap:full --verify",
|
||||
"uniswap:kovan:dev:migration": "npm run hardhat:kovan -- uniswap:dev --verify",
|
||||
"uniswap:kovan:full:migration": "npm run hardhat:kovan -- uniswap:full --verify",
|
||||
"uniswap:ropsten:dev:migration": "npm run hardhat:ropsten -- uniswap:dev --verify",
|
||||
"uniswap:ropsten:full:migration": "npm run hardhat:ropsten -- uniswap:full --verify",
|
||||
"uniswap:main:dev:migration": "npm run hardhat:main -- uniswap:dev --verify",
|
||||
"uniswap:main:full:migration": "npm run hardhat:main -- uniswap:full --verify",
|
||||
"test-repay-with-collateral": "hardhat test test/__setup.spec.ts test/repay-with-collateral.spec.ts",
|
||||
"test-liquidate-with-collateral": "hardhat test test/__setup.spec.ts test/flash-liquidation-with-collateral.spec.ts",
|
||||
"test-liquidate-underlying": "hardhat test test/__setup.spec.ts test/liquidation-underlying.spec.ts",
|
||||
|
@ -44,9 +26,16 @@
|
|||
"test-stable-and-atokens": "hardhat test test/__setup.spec.ts test/atoken-transfer.spec.ts test/stable-token.spec.ts",
|
||||
"test-subgraph:scenarios": "hardhat --network hardhatevm_docker test test/__setup.spec.ts test/subgraph-scenarios.spec.ts",
|
||||
"test-weth": "hardhat test test/__setup.spec.ts test/weth-gateway.spec.ts",
|
||||
"test:main:check-list": "MAINNET_FORK=true TS_NODE_TRANSPILE_ONLY=1 hardhat test test/__setup.spec.ts test/mainnet/check-list.spec.ts",
|
||||
"dev:coverage": "buidler compile --force && buidler coverage --network coverage",
|
||||
"dev:deployment": "hardhat dev-deployment",
|
||||
"dev:deployExample": "hardhat deploy-Example",
|
||||
"aave:evm:dev:migration": "npm run compile && hardhat aave:dev",
|
||||
"aave:docker:full:migration": "npm run compile && npm run hardhat:docker -- aave:mainnet",
|
||||
"aave:kovan:full:migration": "npm run compile && npm run hardhat:kovan -- aave:mainnet --verify",
|
||||
"aave:kovan:full:initialize": "npm run hardhat:kovan -- full:initialize-lending-pool --verify --pool Aave",
|
||||
"aave:ropsten:full:migration": "npm run compile && npm run hardhat:ropsten -- aave:mainnet --verify",
|
||||
"aave:fork:main:tenderly": "npm run compile && npm run hardhat:tenderly-main -- aave:mainnet",
|
||||
"aave:fork:main": "MAINNET_FORK=true npm run compile && hardhat aave:mainnet",
|
||||
"aave:main:full:migration": "npm run hardhat:main -- aave:mainnet --verify",
|
||||
"dev:prettier": "prettier --write .",
|
||||
"ci:test": "npm run compile && npm run test",
|
||||
"ci:clean": "rm -rf ./artifacts ./cache ./types",
|
||||
|
@ -69,6 +58,7 @@
|
|||
"@nomiclabs/hardhat-ethers": "^2.0.0",
|
||||
"@nomiclabs/hardhat-waffle": "^2.0.0",
|
||||
"@openzeppelin/contracts": "3.1.0",
|
||||
"@tenderly/hardhat-tenderly": "^1.1.0-beta.3",
|
||||
"@typechain/ethers-v4": "1.0.0",
|
||||
"@typechain/ethers-v5": "^1.0.0",
|
||||
"@typechain/truffle-v4": "2.0.2",
|
||||
|
@ -125,6 +115,10 @@
|
|||
{
|
||||
"name": "Andrey Kozlov",
|
||||
"email": "andrey@aave.com"
|
||||
},
|
||||
{
|
||||
"name": "David Racero",
|
||||
"email": "david.k@aave.com"
|
||||
}
|
||||
],
|
||||
"license": "AGPLv3",
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import {task} from 'hardhat/config';
|
||||
import {
|
||||
deployPriceOracle,
|
||||
deployChainlinkProxyPriceProvider,
|
||||
deployAaveOracle,
|
||||
deployLendingRateOracle,
|
||||
} from '../../helpers/contracts-deployments';
|
||||
|
||||
|
@ -58,7 +58,7 @@ task('dev:deploy-oracles', 'Deploy oracles for dev enviroment')
|
|||
allAggregatorsAddresses
|
||||
);
|
||||
|
||||
await deployChainlinkProxyPriceProvider(
|
||||
await deployAaveOracle(
|
||||
[tokens, aggregators, fallbackOracle.address, await getWethAddress(poolConfig)],
|
||||
verify
|
||||
);
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
import {task} from 'hardhat/config';
|
||||
import {getParamPerNetwork} from '../../helpers/contracts-helpers';
|
||||
import {getEthersSignersAddresses, getParamPerNetwork} from '../../helpers/contracts-helpers';
|
||||
import {
|
||||
deployLendingPoolAddressesProvider,
|
||||
deployLendingPoolAddressesProviderRegistry,
|
||||
} from '../../helpers/contracts-deployments';
|
||||
import {waitForTx} from '../../helpers/misc-utils';
|
||||
import {notFalsyOrZeroAddress, waitForTx} from '../../helpers/misc-utils';
|
||||
import {
|
||||
ConfigNames,
|
||||
loadPoolConfig,
|
||||
|
@ -20,25 +20,27 @@ task(
|
|||
)
|
||||
.addFlag('verify', 'Verify contracts at Etherscan')
|
||||
.addParam('pool', `Pool name to retrieve configuration, supported: ${Object.values(ConfigNames)}`)
|
||||
.setAction(async ({verify, pool}, localBRE) => {
|
||||
await localBRE.run('set-DRE');
|
||||
const network = <eEthereumNetwork>localBRE.network.name;
|
||||
.setAction(async ({verify, pool}, DRE) => {
|
||||
await DRE.run('set-DRE');
|
||||
|
||||
const network = <eEthereumNetwork>DRE.network.name;
|
||||
const poolConfig = loadPoolConfig(pool);
|
||||
const {ProviderId} = poolConfig;
|
||||
|
||||
const providerRegistryAddress = getParamPerNetwork(poolConfig.ProviderRegistry, network);
|
||||
// Deploy address provider and set genesis manager
|
||||
const addressesProvider = await deployLendingPoolAddressesProvider(verify);
|
||||
await waitForTx(await addressesProvider.setPoolAdmin(await getGenesisPoolAdmin(poolConfig)));
|
||||
const admin = await getEmergencyAdmin(poolConfig);
|
||||
console.log('Admin is ', admin);
|
||||
|
||||
await waitForTx(await addressesProvider.setEmergencyAdmin(admin));
|
||||
await waitForTx(await addressesProvider.setPoolAdmin(await getGenesisPoolAdmin(poolConfig)));
|
||||
await waitForTx(await addressesProvider.setEmergencyAdmin(await getEmergencyAdmin(poolConfig)));
|
||||
|
||||
console.log('Pool Admin', await addressesProvider.getPoolAdmin());
|
||||
console.log('Emergency Admin', await addressesProvider.getEmergencyAdmin());
|
||||
|
||||
// If no provider registry is set, deploy lending pool address provider registry and register the address provider
|
||||
const addressesProviderRegistry = !providerRegistryAddress
|
||||
? await deployLendingPoolAddressesProviderRegistry(verify)
|
||||
: await getLendingPoolAddressesProviderRegistry(providerRegistryAddress);
|
||||
const addressesProviderRegistry = notFalsyOrZeroAddress(providerRegistryAddress)
|
||||
? await getLendingPoolAddressesProviderRegistry(providerRegistryAddress)
|
||||
: await deployLendingPoolAddressesProviderRegistry(verify);
|
||||
|
||||
await waitForTx(
|
||||
await addressesProviderRegistry.registerAddressesProvider(
|
||||
|
@ -46,18 +48,4 @@ task(
|
|||
ProviderId
|
||||
)
|
||||
);
|
||||
|
||||
//register the proxy price provider on the addressesProvider
|
||||
const proxyProvider = getParamPerNetwork(poolConfig.ProxyPriceProvider, network);
|
||||
|
||||
if (proxyProvider && proxyProvider !== '') {
|
||||
await waitForTx(await addressesProvider.setPriceOracle(proxyProvider));
|
||||
}
|
||||
|
||||
//register the lending rate oracle
|
||||
const lendingRateOracle = getParamPerNetwork(poolConfig.LendingRateOracle, network);
|
||||
|
||||
if (lendingRateOracle && lendingRateOracle !== '') {
|
||||
await waitForTx(await addressesProvider.setLendingRateOracle(lendingRateOracle));
|
||||
}
|
||||
});
|
|
@ -1,5 +1,8 @@
|
|||
import {task} from 'hardhat/config';
|
||||
import {insertContractAddressInDb} from '../../helpers/contracts-helpers';
|
||||
import {
|
||||
getEthersSignersAddresses,
|
||||
insertContractAddressInDb,
|
||||
} from '../../helpers/contracts-helpers';
|
||||
import {
|
||||
deployATokensAndRatesHelper,
|
||||
deployLendingPool,
|
||||
|
@ -16,45 +19,55 @@ import {
|
|||
|
||||
task('full:deploy-lending-pool', 'Deploy lending pool for dev enviroment')
|
||||
.addFlag('verify', 'Verify contracts at Etherscan')
|
||||
.setAction(async ({verify}, localBRE) => {
|
||||
await localBRE.run('set-DRE');
|
||||
.setAction(async ({verify}, DRE) => {
|
||||
try {
|
||||
await DRE.run('set-DRE');
|
||||
|
||||
const addressesProvider = await getLendingPoolAddressesProvider();
|
||||
const addressesProvider = await getLendingPoolAddressesProvider();
|
||||
|
||||
// Deploy lending pool
|
||||
const lendingPoolImpl = await deployLendingPool(verify);
|
||||
// Deploy lending pool
|
||||
const lendingPoolImpl = await deployLendingPool(verify);
|
||||
|
||||
// Set lending pool impl to address provider
|
||||
await waitForTx(await addressesProvider.setLendingPoolImpl(lendingPoolImpl.address));
|
||||
// Set lending pool impl to address provider
|
||||
await waitForTx(await addressesProvider.setLendingPoolImpl(lendingPoolImpl.address));
|
||||
|
||||
const address = await addressesProvider.getLendingPool();
|
||||
const lendingPoolProxy = await getLendingPool(address);
|
||||
const address = await addressesProvider.getLendingPool();
|
||||
const lendingPoolProxy = await getLendingPool(address);
|
||||
|
||||
await insertContractAddressInDb(eContractid.LendingPool, lendingPoolProxy.address);
|
||||
await insertContractAddressInDb(eContractid.LendingPool, lendingPoolProxy.address);
|
||||
|
||||
// Deploy lending pool configurator
|
||||
const lendingPoolConfiguratorImpl = await deployLendingPoolConfigurator(verify);
|
||||
// Deploy lending pool configurator
|
||||
const lendingPoolConfiguratorImpl = await deployLendingPoolConfigurator(verify);
|
||||
|
||||
// Set lending pool conf impl to Address Provider
|
||||
await waitForTx(
|
||||
await addressesProvider.setLendingPoolConfiguratorImpl(lendingPoolConfiguratorImpl.address)
|
||||
);
|
||||
// Set lending pool conf impl to Address Provider
|
||||
await waitForTx(
|
||||
await addressesProvider.setLendingPoolConfiguratorImpl(lendingPoolConfiguratorImpl.address)
|
||||
);
|
||||
|
||||
const lendingPoolConfiguratorProxy = await getLendingPoolConfiguratorProxy(
|
||||
await addressesProvider.getLendingPoolConfigurator()
|
||||
);
|
||||
const lendingPoolConfiguratorProxy = await getLendingPoolConfiguratorProxy(
|
||||
await addressesProvider.getLendingPoolConfigurator()
|
||||
);
|
||||
|
||||
await insertContractAddressInDb(
|
||||
eContractid.LendingPoolConfigurator,
|
||||
lendingPoolConfiguratorProxy.address
|
||||
);
|
||||
// Deploy deployment helpers
|
||||
await deployStableAndVariableTokensHelper(
|
||||
[lendingPoolProxy.address, addressesProvider.address],
|
||||
verify
|
||||
);
|
||||
await deployATokensAndRatesHelper(
|
||||
[lendingPoolProxy.address, addressesProvider.address, lendingPoolConfiguratorProxy.address],
|
||||
verify
|
||||
);
|
||||
await insertContractAddressInDb(
|
||||
eContractid.LendingPoolConfigurator,
|
||||
lendingPoolConfiguratorProxy.address
|
||||
);
|
||||
// Deploy deployment helpers
|
||||
await deployStableAndVariableTokensHelper(
|
||||
[lendingPoolProxy.address, addressesProvider.address],
|
||||
verify
|
||||
);
|
||||
await deployATokensAndRatesHelper(
|
||||
[lendingPoolProxy.address, addressesProvider.address, lendingPoolConfiguratorProxy.address],
|
||||
verify
|
||||
);
|
||||
} catch (error) {
|
||||
if (DRE.network.name.includes('tenderly')) {
|
||||
const transactionLink = `https://dashboard.tenderly.co/${DRE.config.tenderly.username}/${
|
||||
DRE.config.tenderly.project
|
||||
}/fork/${DRE.tenderlyRPC.getFork()}/simulation/${DRE.tenderlyRPC.getHead()}`;
|
||||
console.error('Check tx error:', transactionLink);
|
||||
}
|
||||
throw error;
|
||||
}
|
||||
});
|
||||
|
|
|
@ -1,41 +1,44 @@
|
|||
import {task} from 'hardhat/config';
|
||||
import {getParamPerNetwork} from '../../helpers/contracts-helpers';
|
||||
import {
|
||||
deployChainlinkProxyPriceProvider,
|
||||
deployLendingRateOracle,
|
||||
} from '../../helpers/contracts-deployments';
|
||||
import {getEthersSignersAddresses, getParamPerNetwork} from '../../helpers/contracts-helpers';
|
||||
import {deployAaveOracle, deployLendingRateOracle} from '../../helpers/contracts-deployments';
|
||||
import {setInitialMarketRatesInRatesOracleByHelper} from '../../helpers/oracles-helpers';
|
||||
import {ICommonConfiguration, eEthereumNetwork, SymbolMap} from '../../helpers/types';
|
||||
import {waitForTx, filterMapBy} from '../../helpers/misc-utils';
|
||||
import {ConfigNames, loadPoolConfig, getWethAddress} from '../../helpers/configuration';
|
||||
import {waitForTx, filterMapBy, notFalsyOrZeroAddress} from '../../helpers/misc-utils';
|
||||
import {
|
||||
ConfigNames,
|
||||
loadPoolConfig,
|
||||
getWethAddress,
|
||||
getGenesisPoolAdmin,
|
||||
getLendingRateOracles,
|
||||
} from '../../helpers/configuration';
|
||||
import {exit} from 'process';
|
||||
import {
|
||||
getChainlinkPriceProvider,
|
||||
getLendingPoolAddressesProvider,
|
||||
getLendingRateOracle,
|
||||
getPairsTokenAggregator,
|
||||
} from '../../helpers/contracts-getters';
|
||||
|
||||
task('full:deploy-oracles', 'Deploy oracles for dev enviroment')
|
||||
.addFlag('verify', 'Verify contracts at Etherscan')
|
||||
.addParam('pool', `Pool name to retrieve configuration, supported: ${Object.values(ConfigNames)}`)
|
||||
.setAction(async ({verify, pool}, localBRE) => {
|
||||
.setAction(async ({verify, pool}, DRE) => {
|
||||
try {
|
||||
await localBRE.run('set-DRE');
|
||||
const network = <eEthereumNetwork>localBRE.network.name;
|
||||
await DRE.run('set-DRE');
|
||||
const network = <eEthereumNetwork>DRE.network.name;
|
||||
const poolConfig = loadPoolConfig(pool);
|
||||
const {
|
||||
ProtocolGlobalParams: {UsdAddress},
|
||||
LendingRateOracleRatesCommon,
|
||||
ReserveAssets,
|
||||
FallbackOracle,
|
||||
ChainlinkAggregator,
|
||||
} = poolConfig as ICommonConfiguration;
|
||||
const lendingRateOracles = filterMapBy(LendingRateOracleRatesCommon, (key) =>
|
||||
Object.keys(ReserveAssets[network]).includes(key)
|
||||
);
|
||||
const lendingRateOracles = getLendingRateOracles(poolConfig);
|
||||
const addressesProvider = await getLendingPoolAddressesProvider();
|
||||
const admin = await addressesProvider.getPoolAdmin();
|
||||
|
||||
const fallbackOracle = await getParamPerNetwork(FallbackOracle, network);
|
||||
const admin = await getGenesisPoolAdmin(poolConfig);
|
||||
const proxyPriceProviderAddress = getParamPerNetwork(poolConfig.ProxyPriceProvider, network);
|
||||
const lendingRateOracleAddress = getParamPerNetwork(poolConfig.LendingRateOracle, network);
|
||||
const fallbackOracleAddress = await getParamPerNetwork(FallbackOracle, network);
|
||||
const reserveAssets = await getParamPerNetwork(ReserveAssets, network);
|
||||
const chainlinkAggregators = await getParamPerNetwork(ChainlinkAggregator, network);
|
||||
|
||||
|
@ -45,26 +48,38 @@ task('full:deploy-oracles', 'Deploy oracles for dev enviroment')
|
|||
};
|
||||
const [tokens, aggregators] = getPairsTokenAggregator(tokensToWatch, chainlinkAggregators);
|
||||
|
||||
const chainlinkProviderPriceProvider = await deployChainlinkProxyPriceProvider(
|
||||
[tokens, aggregators, fallbackOracle, await getWethAddress(poolConfig)],
|
||||
verify
|
||||
);
|
||||
const chainlinkProviderPriceProvider = notFalsyOrZeroAddress(proxyPriceProviderAddress)
|
||||
? await getChainlinkPriceProvider(proxyPriceProviderAddress)
|
||||
: await deployAaveOracle(
|
||||
[tokens, aggregators, fallbackOracleAddress, await getWethAddress(poolConfig)],
|
||||
verify
|
||||
);
|
||||
const lendingRateOracle = notFalsyOrZeroAddress(lendingRateOracleAddress)
|
||||
? await getLendingRateOracle(lendingRateOracleAddress)
|
||||
: await deployLendingRateOracle(verify);
|
||||
const {USD, ...tokensAddressesWithoutUsd} = tokensToWatch;
|
||||
|
||||
if (!lendingRateOracleAddress) {
|
||||
await setInitialMarketRatesInRatesOracleByHelper(
|
||||
lendingRateOracles,
|
||||
tokensAddressesWithoutUsd,
|
||||
lendingRateOracle,
|
||||
admin
|
||||
);
|
||||
}
|
||||
|
||||
// Register the proxy price provider on the addressesProvider
|
||||
await waitForTx(
|
||||
await addressesProvider.setPriceOracle(chainlinkProviderPriceProvider.address)
|
||||
);
|
||||
|
||||
const lendingRateOracle = await deployLendingRateOracle(verify);
|
||||
await waitForTx(await addressesProvider.setLendingRateOracle(lendingRateOracle.address));
|
||||
|
||||
const {USD, ...tokensAddressesWithoutUsd} = tokensToWatch;
|
||||
await setInitialMarketRatesInRatesOracleByHelper(
|
||||
lendingRateOracles,
|
||||
tokensAddressesWithoutUsd,
|
||||
lendingRateOracle,
|
||||
admin
|
||||
);
|
||||
} catch (err) {
|
||||
console.error(err);
|
||||
exit(1);
|
||||
} catch (error) {
|
||||
if (DRE.network.name.includes('tenderly')) {
|
||||
const transactionLink = `https://dashboard.tenderly.co/${DRE.config.tenderly.username}/${
|
||||
DRE.config.tenderly.project
|
||||
}/fork/${DRE.tenderlyRPC.getFork()}/simulation/${DRE.tenderlyRPC.getHead()}`;
|
||||
console.error('Check tx error:', transactionLink);
|
||||
}
|
||||
throw error;
|
||||
}
|
||||
});
|
||||
|
|
|
@ -1,41 +0,0 @@
|
|||
import {task} from 'hardhat/config';
|
||||
import {checkVerification} from '../../helpers/etherscan-verification';
|
||||
import {ConfigNames} from '../../helpers/configuration';
|
||||
import {EthereumNetworkNames} from '../../helpers/types';
|
||||
import {printContracts} from '../../helpers/misc-utils';
|
||||
|
||||
task('aave:full', 'Deploy development enviroment')
|
||||
.addFlag('verify', 'Verify contracts at Etherscan')
|
||||
.setAction(async ({verify}, localBRE) => {
|
||||
const POOL_NAME = ConfigNames.Aave;
|
||||
const network = <EthereumNetworkNames>localBRE.network.name;
|
||||
|
||||
await localBRE.run('set-DRE');
|
||||
|
||||
// Prevent loss of gas verifying all the needed ENVs for Etherscan verification
|
||||
if (verify) {
|
||||
checkVerification();
|
||||
}
|
||||
|
||||
console.log('Migration started\n');
|
||||
|
||||
console.log('1. Deploy address provider');
|
||||
await localBRE.run('full:deploy-address-provider', {pool: POOL_NAME});
|
||||
|
||||
console.log('2. Deploy lending pool');
|
||||
await localBRE.run('full:deploy-lending-pool');
|
||||
|
||||
console.log('3. Initialize lending pool');
|
||||
await localBRE.run('full:initialize-lending-pool', {pool: POOL_NAME});
|
||||
|
||||
if (verify) {
|
||||
printContracts();
|
||||
console.log('4. Veryfing contracts');
|
||||
await localBRE.run('verify:general', {all: true, pool: POOL_NAME});
|
||||
|
||||
console.log('5. Veryfing aTokens and debtTokens');
|
||||
await localBRE.run('verify:tokens', {pool: POOL_NAME});
|
||||
}
|
||||
console.log('\nFinished migrations');
|
||||
printContracts();
|
||||
});
|
59
tasks/migrations/aave.mainnet.ts
Normal file
59
tasks/migrations/aave.mainnet.ts
Normal file
|
@ -0,0 +1,59 @@
|
|||
import {task} from 'hardhat/config';
|
||||
import {ExternalProvider} from '@ethersproject/providers';
|
||||
import {checkVerification} from '../../helpers/etherscan-verification';
|
||||
import {ConfigNames} from '../../helpers/configuration';
|
||||
import {EthereumNetworkNames} from '../../helpers/types';
|
||||
import {printContracts} from '../../helpers/misc-utils';
|
||||
|
||||
task('aave:mainnet', 'Deploy development enviroment')
|
||||
.addFlag('verify', 'Verify contracts at Etherscan')
|
||||
.setAction(async ({verify}, DRE) => {
|
||||
const POOL_NAME = ConfigNames.Aave;
|
||||
const network = <EthereumNetworkNames>DRE.network.name;
|
||||
await DRE.run('set-DRE');
|
||||
|
||||
// Prevent loss of gas verifying all the needed ENVs for Etherscan verification
|
||||
if (verify) {
|
||||
checkVerification();
|
||||
}
|
||||
|
||||
if (network.includes('tenderly')) {
|
||||
console.log('- Setting up Tenderly provider');
|
||||
await DRE.tenderlyRPC.initializeFork();
|
||||
const provider = new DRE.ethers.providers.Web3Provider(DRE.tenderlyRPC as any);
|
||||
DRE.ethers.provider = provider;
|
||||
}
|
||||
|
||||
console.log('Migration started\n');
|
||||
|
||||
console.log('1. Deploy address provider');
|
||||
await DRE.run('full:deploy-address-provider', {pool: POOL_NAME});
|
||||
|
||||
console.log('2. Deploy lending pool');
|
||||
await DRE.run('full:deploy-lending-pool');
|
||||
|
||||
console.log('3. Deploy oracles');
|
||||
await DRE.run('full:deploy-oracles', {pool: POOL_NAME});
|
||||
|
||||
console.log('4. Deploy Data Provider');
|
||||
await DRE.run('full:data-provider', {pool: POOL_NAME});
|
||||
|
||||
console.log('5. Initialize lending pool');
|
||||
await DRE.run('full:initialize-lending-pool', {pool: POOL_NAME});
|
||||
|
||||
if (verify) {
|
||||
printContracts();
|
||||
console.log('4. Veryfing contracts');
|
||||
await DRE.run('verify:general', {all: true, pool: POOL_NAME});
|
||||
|
||||
console.log('5. Veryfing aTokens and debtTokens');
|
||||
await DRE.run('verify:tokens', {pool: POOL_NAME});
|
||||
}
|
||||
|
||||
if (network.includes('tenderly')) {
|
||||
const postDeployHead = DRE.tenderlyRPC.getHead();
|
||||
console.log('Tenderly UUID', postDeployHead);
|
||||
}
|
||||
console.log('\nFinished migrations');
|
||||
printContracts();
|
||||
});
|
|
@ -1,35 +0,0 @@
|
|||
import {task} from 'hardhat/config';
|
||||
import {checkVerification} from '../../helpers/etherscan-verification';
|
||||
import {ConfigNames} from '../../helpers/configuration';
|
||||
|
||||
task('uniswap:dev', 'Deploy development enviroment')
|
||||
.addOptionalParam('verify', 'Verify contracts at Etherscan')
|
||||
.setAction(async ({verify}, localBRE) => {
|
||||
const POOL_NAME = ConfigNames.Uniswap;
|
||||
|
||||
await localBRE.run('set-DRE');
|
||||
|
||||
// Prevent loss of gas verifying all the needed ENVs for Etherscan verification
|
||||
if (verify) {
|
||||
checkVerification();
|
||||
}
|
||||
|
||||
console.log('Migration started\n');
|
||||
|
||||
console.log('1. Deploy mock tokens');
|
||||
await localBRE.run('dev:deploy-mock-tokens', {verify});
|
||||
|
||||
console.log('2. Deploy address provider');
|
||||
await localBRE.run('dev:deploy-address-provider', {verify});
|
||||
|
||||
console.log('3. Deploy lending pool');
|
||||
await localBRE.run('dev:deploy-lending-pool', {verify});
|
||||
|
||||
console.log('4. Deploy oracles');
|
||||
await localBRE.run('dev:deploy-oracles', {verify, pool: POOL_NAME});
|
||||
|
||||
console.log('5. Initialize lending pool');
|
||||
await localBRE.run('dev:initialize-lending-pool', {verify, pool: POOL_NAME});
|
||||
|
||||
console.log('\nFinished migration');
|
||||
});
|
|
@ -1,32 +0,0 @@
|
|||
import {task} from 'hardhat/config';
|
||||
import {checkVerification} from '../../helpers/etherscan-verification';
|
||||
import {ConfigNames} from '../../helpers/configuration';
|
||||
|
||||
task('uniswap:full', 'Deploy development enviroment')
|
||||
.addFlag('verify', 'Verify contracts at Etherscan')
|
||||
.setAction(async ({verify}, localBRE) => {
|
||||
const POOL_NAME = ConfigNames.Uniswap;
|
||||
|
||||
await localBRE.run('set-DRE');
|
||||
|
||||
// Prevent loss of gas verifying all the needed ENVs for Etherscan verification
|
||||
if (verify) {
|
||||
checkVerification();
|
||||
}
|
||||
|
||||
console.log('Migration started\n');
|
||||
|
||||
console.log('1. Deploy address provider');
|
||||
await localBRE.run('full:deploy-address-provider', {verify, pool: POOL_NAME});
|
||||
|
||||
console.log('2. Deploy lending pool');
|
||||
await localBRE.run('full:deploy-lending-pool', {verify});
|
||||
|
||||
console.log('3. Deploy oracles');
|
||||
await localBRE.run('full:deploy-oracles', {verify, pool: POOL_NAME});
|
||||
|
||||
console.log('4. Initialize lending pool');
|
||||
await localBRE.run('full:initialize-lending-pool', {verify, pool: POOL_NAME});
|
||||
|
||||
console.log('\nFinished migrations');
|
||||
});
|
|
@ -1,3 +1,5 @@
|
|||
import {ExternalProvider} from '@ethersproject/providers';
|
||||
|
||||
import {task} from 'hardhat/config';
|
||||
import {setDRE} from '../../helpers/misc-utils';
|
||||
|
||||
|
|
|
@ -12,7 +12,7 @@ import {
|
|||
deployLendingPoolConfigurator,
|
||||
deployLendingPool,
|
||||
deployPriceOracle,
|
||||
deployChainlinkProxyPriceProvider,
|
||||
deployAaveOracle,
|
||||
deployLendingPoolCollateralManager,
|
||||
deployMockFlashLoanReceiver,
|
||||
deployWalletBalancerProvider,
|
||||
|
@ -26,7 +26,7 @@ import {
|
|||
import {Signer} from 'ethers';
|
||||
import {TokenContractId, eContractid, tEthereumAddress, AavePools} from '../helpers/types';
|
||||
import {MintableErc20 as MintableERC20} from '../types/MintableErc20';
|
||||
import {getEmergencyAdmin, getReservesConfigByPool} from '../helpers/configuration';
|
||||
import {getReservesConfigByPool} from '../helpers/configuration';
|
||||
import {initializeMakeSuite} from './helpers/make-suite';
|
||||
|
||||
import {
|
||||
|
@ -40,7 +40,7 @@ import {
|
|||
enableReservesToBorrowByHelper,
|
||||
enableReservesAsCollateralByHelper,
|
||||
} from '../helpers/init-helpers';
|
||||
import {AaveConfig} from '../config/aave';
|
||||
import AaveConfig from '../markets/aave';
|
||||
import {ZERO_ADDRESS} from '../helpers/constants';
|
||||
import {
|
||||
getLendingPool,
|
||||
|
@ -201,7 +201,7 @@ const buildTestEnv = async (deployer: Signer, secondaryWallet: Signer) => {
|
|||
|
||||
const [tokens, aggregators] = getPairsTokenAggregator(allTokenAddresses, allAggregatorsAddresses);
|
||||
|
||||
const chainlinkProxyPriceProvider = await deployChainlinkProxyPriceProvider([
|
||||
const aaveOracle = await deployAaveOracle([
|
||||
tokens,
|
||||
aggregators,
|
||||
fallbackOracle.address,
|
||||
|
@ -273,8 +273,15 @@ const buildTestEnv = async (deployer: Signer, secondaryWallet: Signer) => {
|
|||
before(async () => {
|
||||
await rawBRE.run('set-DRE');
|
||||
const [deployer, secondaryWallet] = await getEthersSigners();
|
||||
console.log('-> Deploying test environment...');
|
||||
await buildTestEnv(deployer, secondaryWallet);
|
||||
const MAINNET_FORK = process.env.MAINNET_FORK === 'true';
|
||||
|
||||
if (MAINNET_FORK) {
|
||||
await rawBRE.run('aave:mainnet');
|
||||
} else {
|
||||
console.log('-> Deploying test environment...');
|
||||
await buildTestEnv(deployer, secondaryWallet);
|
||||
}
|
||||
|
||||
await initializeMakeSuite();
|
||||
console.log('\n***************');
|
||||
console.log('Setup and snapshot finished');
|
||||
|
|
|
@ -4,7 +4,7 @@ import {expect} from 'chai';
|
|||
import {ethers} from 'ethers';
|
||||
import {RateMode, ProtocolErrors} from '../helpers/types';
|
||||
import {makeSuite, TestEnv} from './helpers/make-suite';
|
||||
import {CommonsConfig} from '../config/commons';
|
||||
import {CommonsConfig} from '../markets/aave/commons';
|
||||
|
||||
const APPROVAL_AMOUNT_LENDING_POOL =
|
||||
CommonsConfig.ProtocolGlobalParams.ApprovalAmountLendingPoolCore;
|
||||
|
|
|
@ -2,7 +2,7 @@ import {TestEnv, makeSuite} from './helpers/make-suite';
|
|||
import {RAY} from '../helpers/constants';
|
||||
import {convertToCurrencyDecimals} from '../helpers/contracts-helpers';
|
||||
import {ProtocolErrors} from '../helpers/types';
|
||||
import {CommonsConfig} from '../config/commons';
|
||||
import {CommonsConfig} from '../markets/aave/commons';
|
||||
|
||||
const APPROVAL_AMOUNT_LENDING_POOL =
|
||||
CommonsConfig.ProtocolGlobalParams.ApprovalAmountLendingPoolCore;
|
||||
|
|
|
@ -107,7 +107,6 @@ export async function initializeMakeSuite() {
|
|||
testEnv.helpersContract = await getAaveProtocolDataProvider();
|
||||
|
||||
const allTokens = await testEnv.helpersContract.getAllATokens();
|
||||
|
||||
const aDaiAddress = allTokens.find((aToken) => aToken.symbol === 'aDAI')?.tokenAddress;
|
||||
|
||||
const aWEthAddress = allTokens.find((aToken) => aToken.symbol === 'aWETH')?.tokenAddress;
|
||||
|
@ -120,11 +119,9 @@ export async function initializeMakeSuite() {
|
|||
const wethAddress = reservesTokens.find((token) => token.symbol === 'WETH')?.tokenAddress;
|
||||
|
||||
if (!aDaiAddress || !aWEthAddress) {
|
||||
console.log(`atoken-modifiers.spec: aTokens not correctly initialized`);
|
||||
process.exit(1);
|
||||
}
|
||||
if (!daiAddress || !usdcAddress || !aaveAddress || !wethAddress) {
|
||||
console.log(`atoken-modifiers.spec: USDC or DAI not correctly initialized`);
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@ import {makeSuite} from './helpers/make-suite';
|
|||
import {ProtocolErrors, RateMode} from '../helpers/types';
|
||||
import {calcExpectedVariableDebtTokenBalance} from './helpers/utils/calculations';
|
||||
import {getUserData, getReserveData} from './helpers/utils/helpers';
|
||||
import {CommonsConfig} from '../config/commons';
|
||||
import {CommonsConfig} from '../markets/aave/commons';
|
||||
|
||||
const APPROVAL_AMOUNT_LENDING_POOL =
|
||||
CommonsConfig.ProtocolGlobalParams.ApprovalAmountLendingPoolCore;
|
||||
|
|
|
@ -7,7 +7,7 @@ import {makeSuite} from './helpers/make-suite';
|
|||
import {ProtocolErrors, RateMode} from '../helpers/types';
|
||||
import {calcExpectedStableDebtTokenBalance} from './helpers/utils/calculations';
|
||||
import {getUserData} from './helpers/utils/helpers';
|
||||
import {CommonsConfig} from '../config/commons';
|
||||
import {CommonsConfig} from '../markets/aave/commons';
|
||||
|
||||
const APPROVAL_AMOUNT_LENDING_POOL =
|
||||
CommonsConfig.ProtocolGlobalParams.ApprovalAmountLendingPoolCore;
|
||||
|
|
362
test/mainnet/check-list.spec.ts
Normal file
362
test/mainnet/check-list.spec.ts
Normal file
|
@ -0,0 +1,362 @@
|
|||
import {MAX_UINT_AMOUNT} from '../../helpers/constants';
|
||||
import {convertToCurrencyDecimals} from '../../helpers/contracts-helpers';
|
||||
import {makeSuite, TestEnv} from '../helpers/make-suite';
|
||||
import {parseEther} from 'ethers/lib/utils';
|
||||
import {DRE, waitForTx} from '../../helpers/misc-utils';
|
||||
import {BigNumber} from 'ethers';
|
||||
import {getStableDebtToken, getVariableDebtToken} from '../../helpers/contracts-getters';
|
||||
import {deploySelfdestructTransferMock} from '../../helpers/contracts-deployments';
|
||||
import {IUniswapV2Router02Factory} from '../../types/IUniswapV2Router02Factory';
|
||||
|
||||
const {expect} = require('chai');
|
||||
|
||||
const UNISWAP_ROUTER = '0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D';
|
||||
|
||||
makeSuite('Mainnet Check list', (testEnv: TestEnv) => {
|
||||
const zero = BigNumber.from('0');
|
||||
const depositSize = parseEther('5');
|
||||
|
||||
it('Deposit WETH', async () => {
|
||||
const {users, wethGateway, aWETH, pool} = testEnv;
|
||||
|
||||
const user = users[1];
|
||||
|
||||
// Deposit with native ETH
|
||||
await wethGateway.connect(user.signer).depositETH(user.address, '0', {value: depositSize});
|
||||
|
||||
const aTokensBalance = await aWETH.balanceOf(user.address);
|
||||
|
||||
expect(aTokensBalance).to.be.gt(zero);
|
||||
expect(aTokensBalance).to.be.gte(depositSize);
|
||||
});
|
||||
|
||||
it('Withdraw WETH - Partial', async () => {
|
||||
const {users, wethGateway, aWETH, pool} = testEnv;
|
||||
|
||||
const user = users[1];
|
||||
const priorEthersBalance = await user.signer.getBalance();
|
||||
const aTokensBalance = await aWETH.balanceOf(user.address);
|
||||
|
||||
expect(aTokensBalance).to.be.gt(zero, 'User should have aTokens.');
|
||||
|
||||
// Partially withdraw native ETH
|
||||
const partialWithdraw = await convertToCurrencyDecimals(aWETH.address, '2');
|
||||
|
||||
// Approve the aTokens to Gateway so Gateway can withdraw and convert to Ether
|
||||
const approveTx = await aWETH
|
||||
.connect(user.signer)
|
||||
.approve(wethGateway.address, MAX_UINT_AMOUNT);
|
||||
const {gasUsed: approveGas} = await waitForTx(approveTx);
|
||||
|
||||
// Partial Withdraw and send native Ether to user
|
||||
const {gasUsed: withdrawGas} = await waitForTx(
|
||||
await wethGateway.connect(user.signer).withdrawETH(partialWithdraw, user.address)
|
||||
);
|
||||
|
||||
const afterPartialEtherBalance = await user.signer.getBalance();
|
||||
const afterPartialATokensBalance = await aWETH.balanceOf(user.address);
|
||||
const gasCosts = approveGas.add(withdrawGas).mul(approveTx.gasPrice);
|
||||
|
||||
expect(afterPartialEtherBalance).to.be.equal(
|
||||
priorEthersBalance.add(partialWithdraw).sub(gasCosts),
|
||||
'User ETHER balance should contain the partial withdraw'
|
||||
);
|
||||
expect(afterPartialATokensBalance).to.be.equal(
|
||||
aTokensBalance.sub(partialWithdraw),
|
||||
'User aWETH balance should be substracted'
|
||||
);
|
||||
});
|
||||
|
||||
it('Withdraw WETH - Full', async () => {
|
||||
const {users, aWETH, wethGateway, pool} = testEnv;
|
||||
|
||||
const user = users[1];
|
||||
const priorEthersBalance = await user.signer.getBalance();
|
||||
const aTokensBalance = await aWETH.balanceOf(user.address);
|
||||
|
||||
expect(aTokensBalance).to.be.gt(zero, 'User should have aTokens.');
|
||||
|
||||
// Approve the aTokens to Gateway so Gateway can withdraw and convert to Ether
|
||||
const approveTx = await aWETH
|
||||
.connect(user.signer)
|
||||
.approve(wethGateway.address, MAX_UINT_AMOUNT);
|
||||
const {gasUsed: approveGas} = await waitForTx(approveTx);
|
||||
|
||||
// Full withdraw
|
||||
const {gasUsed: withdrawGas} = await waitForTx(
|
||||
await wethGateway.connect(user.signer).withdrawETH(MAX_UINT_AMOUNT, user.address)
|
||||
);
|
||||
|
||||
const afterFullEtherBalance = await user.signer.getBalance();
|
||||
const afterFullATokensBalance = await aWETH.balanceOf(user.address);
|
||||
const gasCosts = approveGas.add(withdrawGas).mul(approveTx.gasPrice);
|
||||
|
||||
expect(afterFullEtherBalance).to.be.eq(
|
||||
priorEthersBalance.add(aTokensBalance).sub(gasCosts),
|
||||
'User ETHER balance should contain the full withdraw'
|
||||
);
|
||||
expect(afterFullATokensBalance).to.be.eq(0, 'User aWETH balance should be zero');
|
||||
});
|
||||
|
||||
it('Borrow stable WETH and Full Repay with ETH', async () => {
|
||||
const {users, wethGateway, aWETH, weth, pool, helpersContract} = testEnv;
|
||||
const borrowSize = parseEther('1');
|
||||
const repaySize = borrowSize.add(borrowSize.mul(5).div(100));
|
||||
const user = users[1];
|
||||
|
||||
const {stableDebtTokenAddress} = await helpersContract.getReserveTokensAddresses(weth.address);
|
||||
|
||||
const stableDebtToken = await getStableDebtToken(stableDebtTokenAddress);
|
||||
|
||||
// Deposit with native ETH
|
||||
await wethGateway.connect(user.signer).depositETH(user.address, '0', {value: depositSize});
|
||||
|
||||
const aTokensBalance = await aWETH.balanceOf(user.address);
|
||||
|
||||
expect(aTokensBalance).to.be.gt(zero);
|
||||
expect(aTokensBalance).to.be.gte(depositSize);
|
||||
|
||||
// Borrow WETH with WETH as collateral
|
||||
await waitForTx(
|
||||
await pool.connect(user.signer).borrow(weth.address, borrowSize, '1', '0', user.address)
|
||||
);
|
||||
|
||||
const debtBalance = await stableDebtToken.balanceOf(user.address);
|
||||
|
||||
expect(debtBalance).to.be.gt(zero);
|
||||
|
||||
// Full Repay WETH with native ETH
|
||||
await waitForTx(
|
||||
await wethGateway
|
||||
.connect(user.signer)
|
||||
.repayETH(MAX_UINT_AMOUNT, '1', user.address, {value: repaySize})
|
||||
);
|
||||
|
||||
const debtBalanceAfterRepay = await stableDebtToken.balanceOf(user.address);
|
||||
expect(debtBalanceAfterRepay).to.be.eq(zero);
|
||||
});
|
||||
|
||||
it('Borrow variable WETH and Full Repay with ETH', async () => {
|
||||
const {users, wethGateway, aWETH, weth, pool, helpersContract} = testEnv;
|
||||
const borrowSize = parseEther('1');
|
||||
const repaySize = borrowSize.add(borrowSize.mul(5).div(100));
|
||||
const user = users[1];
|
||||
|
||||
const {variableDebtTokenAddress} = await helpersContract.getReserveTokensAddresses(
|
||||
weth.address
|
||||
);
|
||||
|
||||
const varDebtToken = await getVariableDebtToken(variableDebtTokenAddress);
|
||||
|
||||
// Deposit with native ETH
|
||||
await wethGateway.connect(user.signer).depositETH(user.address, '0', {value: depositSize});
|
||||
|
||||
const aTokensBalance = await aWETH.balanceOf(user.address);
|
||||
|
||||
expect(aTokensBalance).to.be.gt(zero);
|
||||
expect(aTokensBalance).to.be.gte(depositSize);
|
||||
|
||||
// Borrow WETH with WETH as collateral
|
||||
await waitForTx(
|
||||
await pool.connect(user.signer).borrow(weth.address, borrowSize, '2', '0', user.address)
|
||||
);
|
||||
|
||||
const debtBalance = await varDebtToken.balanceOf(user.address);
|
||||
|
||||
expect(debtBalance).to.be.gt(zero);
|
||||
|
||||
// Partial Repay WETH loan with native ETH
|
||||
const partialPayment = repaySize.div(2);
|
||||
await waitForTx(
|
||||
await wethGateway
|
||||
.connect(user.signer)
|
||||
.repayETH(partialPayment, '2', user.address, {value: partialPayment})
|
||||
);
|
||||
|
||||
const debtBalanceAfterPartialRepay = await varDebtToken.balanceOf(user.address);
|
||||
expect(debtBalanceAfterPartialRepay).to.be.lt(debtBalance);
|
||||
|
||||
// Full Repay WETH loan with native ETH
|
||||
await waitForTx(
|
||||
await wethGateway
|
||||
.connect(user.signer)
|
||||
.repayETH(MAX_UINT_AMOUNT, '2', user.address, {value: repaySize})
|
||||
);
|
||||
const debtBalanceAfterFullRepay = await varDebtToken.balanceOf(user.address);
|
||||
expect(debtBalanceAfterFullRepay).to.be.eq(zero);
|
||||
});
|
||||
|
||||
it('Borrow ETH via delegateApprove ETH and repays back', async () => {
|
||||
const {users, wethGateway, aWETH, weth, helpersContract} = testEnv;
|
||||
const borrowSize = parseEther('1');
|
||||
const user = users[2];
|
||||
const {variableDebtTokenAddress} = await helpersContract.getReserveTokensAddresses(
|
||||
weth.address
|
||||
);
|
||||
const varDebtToken = await getVariableDebtToken(variableDebtTokenAddress);
|
||||
|
||||
const priorDebtBalance = await varDebtToken.balanceOf(user.address);
|
||||
expect(priorDebtBalance).to.be.eq(zero);
|
||||
|
||||
// Deposit WETH with native ETH
|
||||
await wethGateway.connect(user.signer).depositETH(user.address, '0', {value: depositSize});
|
||||
|
||||
const aTokensBalance = await aWETH.balanceOf(user.address);
|
||||
|
||||
expect(aTokensBalance).to.be.gt(zero);
|
||||
expect(aTokensBalance).to.be.gte(depositSize);
|
||||
|
||||
// Delegates borrowing power of WETH to WETHGateway
|
||||
await waitForTx(
|
||||
await varDebtToken.connect(user.signer).approveDelegation(wethGateway.address, borrowSize)
|
||||
);
|
||||
|
||||
// Borrows ETH with WETH as collateral
|
||||
await waitForTx(await wethGateway.connect(user.signer).borrowETH(borrowSize, '2', '0'));
|
||||
|
||||
const debtBalance = await varDebtToken.balanceOf(user.address);
|
||||
|
||||
expect(debtBalance).to.be.gt(zero);
|
||||
|
||||
// Full Repay WETH loan with native ETH
|
||||
await waitForTx(
|
||||
await wethGateway
|
||||
.connect(user.signer)
|
||||
.repayETH(MAX_UINT_AMOUNT, '2', user.address, {value: borrowSize.mul(2)})
|
||||
);
|
||||
const debtBalanceAfterFullRepay = await varDebtToken.balanceOf(user.address);
|
||||
expect(debtBalanceAfterFullRepay).to.be.eq(zero);
|
||||
});
|
||||
|
||||
it('Should revert if receiver function receives Ether if not WETH', async () => {
|
||||
const {users, wethGateway} = testEnv;
|
||||
const user = users[0];
|
||||
const amount = parseEther('1');
|
||||
|
||||
// Call receiver function (empty data + value)
|
||||
await expect(
|
||||
user.signer.sendTransaction({
|
||||
to: wethGateway.address,
|
||||
value: amount,
|
||||
gasLimit: DRE.network.config.gas,
|
||||
})
|
||||
).to.be.revertedWith('Receive not allowed');
|
||||
});
|
||||
|
||||
it('Should revert if fallback functions is called with Ether', async () => {
|
||||
const {users, wethGateway} = testEnv;
|
||||
const user = users[0];
|
||||
const amount = parseEther('1');
|
||||
const fakeABI = ['function wantToCallFallback()'];
|
||||
const abiCoder = new DRE.ethers.utils.Interface(fakeABI);
|
||||
const fakeMethodEncoded = abiCoder.encodeFunctionData('wantToCallFallback', []);
|
||||
|
||||
// Call fallback function with value
|
||||
await expect(
|
||||
user.signer.sendTransaction({
|
||||
to: wethGateway.address,
|
||||
data: fakeMethodEncoded,
|
||||
value: amount,
|
||||
gasLimit: DRE.network.config.gas,
|
||||
})
|
||||
).to.be.revertedWith('Fallback not allowed');
|
||||
});
|
||||
|
||||
it('Should revert if fallback functions is called', async () => {
|
||||
const {users, wethGateway} = testEnv;
|
||||
const user = users[0];
|
||||
|
||||
const fakeABI = ['function wantToCallFallback()'];
|
||||
const abiCoder = new DRE.ethers.utils.Interface(fakeABI);
|
||||
const fakeMethodEncoded = abiCoder.encodeFunctionData('wantToCallFallback', []);
|
||||
|
||||
// Call fallback function without value
|
||||
await expect(
|
||||
user.signer.sendTransaction({
|
||||
to: wethGateway.address,
|
||||
data: fakeMethodEncoded,
|
||||
gasLimit: DRE.network.config.gas,
|
||||
})
|
||||
).to.be.revertedWith('Fallback not allowed');
|
||||
});
|
||||
|
||||
it('Getters should retrieve correct state', async () => {
|
||||
const {aWETH, weth, pool, wethGateway} = testEnv;
|
||||
|
||||
const WETHAddress = await wethGateway.getWETHAddress();
|
||||
const aWETHAddress = await wethGateway.getAWETHAddress();
|
||||
const poolAddress = await wethGateway.getLendingPoolAddress();
|
||||
|
||||
expect(WETHAddress).to.be.equal(weth.address);
|
||||
expect(aWETHAddress).to.be.equal(aWETH.address);
|
||||
expect(poolAddress).to.be.equal(pool.address);
|
||||
});
|
||||
|
||||
it('Owner can do emergency token recovery', async () => {
|
||||
const {users, weth, dai, wethGateway, deployer} = testEnv;
|
||||
const user = users[0];
|
||||
const amount = parseEther('1');
|
||||
|
||||
const uniswapRouter = IUniswapV2Router02Factory.connect(UNISWAP_ROUTER, user.signer);
|
||||
await uniswapRouter.swapETHForExactTokens(
|
||||
amount, // 1 DAI
|
||||
[weth.address, dai.address], // Uniswap paths WETH - DAI
|
||||
user.address,
|
||||
(await DRE.ethers.provider.getBlock('latest')).timestamp + 300,
|
||||
{
|
||||
value: amount, // 1 Ether, we get refund of the unneeded Ether to buy 1 DAI
|
||||
}
|
||||
);
|
||||
const daiBalanceAfterMint = await dai.balanceOf(user.address);
|
||||
|
||||
await dai.connect(user.signer).transfer(wethGateway.address, amount);
|
||||
const daiBalanceAfterBadTransfer = await dai.balanceOf(user.address);
|
||||
expect(daiBalanceAfterBadTransfer).to.be.eq(
|
||||
daiBalanceAfterMint.sub(amount),
|
||||
'User should have lost the funds here.'
|
||||
);
|
||||
|
||||
await wethGateway
|
||||
.connect(deployer.signer)
|
||||
.emergencyTokenTransfer(dai.address, user.address, amount);
|
||||
const daiBalanceAfterRecovery = await dai.balanceOf(user.address);
|
||||
|
||||
expect(daiBalanceAfterRecovery).to.be.eq(
|
||||
daiBalanceAfterMint,
|
||||
'User should recover the funds due emergency token transfer'
|
||||
);
|
||||
});
|
||||
|
||||
it('Owner can do emergency native ETH recovery', async () => {
|
||||
const {users, wethGateway, deployer} = testEnv;
|
||||
const user = users[0];
|
||||
const amount = parseEther('1');
|
||||
const userBalancePriorCall = await user.signer.getBalance();
|
||||
|
||||
// Deploy contract with payable selfdestruct contract
|
||||
const selfdestructContract = await deploySelfdestructTransferMock();
|
||||
|
||||
// Selfdestruct the mock, pointing to WETHGateway address
|
||||
const callTx = await selfdestructContract
|
||||
.connect(user.signer)
|
||||
.destroyAndTransfer(wethGateway.address, {value: amount});
|
||||
const {gasUsed} = await waitForTx(callTx);
|
||||
const gasFees = gasUsed.mul(callTx.gasPrice);
|
||||
const userBalanceAfterCall = await user.signer.getBalance();
|
||||
|
||||
expect(userBalanceAfterCall).to.be.eq(userBalancePriorCall.sub(amount).sub(gasFees), '');
|
||||
'User should have lost the funds';
|
||||
|
||||
// Recover the funds from the contract and sends back to the user
|
||||
await wethGateway.connect(deployer.signer).emergencyEtherTransfer(user.address, amount);
|
||||
|
||||
const userBalanceAfterRecovery = await user.signer.getBalance();
|
||||
const wethGatewayAfterRecovery = await DRE.ethers.provider.getBalance(wethGateway.address);
|
||||
|
||||
expect(userBalanceAfterRecovery).to.be.eq(
|
||||
userBalancePriorCall.sub(gasFees),
|
||||
'User should recover the funds due emergency eth transfer.'
|
||||
);
|
||||
expect(wethGatewayAfterRecovery).to.be.eq('0', 'WETHGateway ether balance should be zero.');
|
||||
});
|
||||
});
|
|
@ -4,11 +4,13 @@
|
|||
"module": "commonjs",
|
||||
"strict": true,
|
||||
"esModuleInterop": true,
|
||||
"outDir": "dist"
|
||||
"outDir": "dist",
|
||||
"noImplicitAny": false
|
||||
},
|
||||
"include": ["./scripts", "./test"],
|
||||
"include": ["./scripts", "./test", "./tasks"],
|
||||
"files": [
|
||||
"./hardhat.config.ts",
|
||||
"./modules/tenderly/tenderly.d.ts",
|
||||
"node_modules/@nomiclabs/buidler-ethers/src/type-extensions.d.ts",
|
||||
"node_modules/buidler-typechain/src/type-extensions.d.ts",
|
||||
"node_modules/@nomiclabs/buidler-waffle/src/type-extensions.d.ts",
|
||||
|
|
Loading…
Reference in New Issue
Block a user