Merge branch 'feat/70-basic-flow-task' into 'master'

Feat/70 basic flow task

See merge request aave-tech/protocol-v2!83
This commit is contained in:
Ernesto Boado 2020-10-27 13:00:32 +00:00
commit c34a22e79f
6 changed files with 1219 additions and 6072 deletions

View File

@ -90,6 +90,16 @@ const buidlerConfig: any = {
balance,
})),
},
buidlerevm_docker: {
hardfork: 'istanbul',
blockGasLimit: 9500000,
gas: 9500000,
gasPrice: 8000000000,
chainId: BUIDLEREVM_CHAINID,
throwOnTransactionFailures: true,
throwOnCallFailures: true,
url: 'http://localhost:8545',
},
ganache: {
url: 'http://ganache:8545',
accounts: {

View File

@ -14,4 +14,13 @@ contract MockAggregator {
function latestAnswer() external view returns (int256) {
return _latestAnswer;
}
function getTokenType() external view returns (uint256) {
return 1;
}
// function getSubTokens() external view returns (address[] memory) {
// TODO: implement mock for when multiple subtokens. Maybe we need to create diff mock contract
// to call it from the migration for this case??
// }
}

View File

@ -563,13 +563,15 @@
"localhost": {
"address": "0xDFbeeed692AA81E7f86E72F7ACbEA2A1C4d63544",
"deployer": "0xc783df8a850f42e7F7e57013759C285caa701eB6"
},
"coverage": {
"address": "0x58F132FBB86E21545A4Bace3C19f1C05d86d7A22",
}
},
"LendingPoolAddressesProviderRegistry": {
"buidlerevm": {
"address": "0x5A0773Ff307Bf7C71a832dBB5312237fD3437f9F",
"deployer": "0xc783df8a850f42e7F7e57013759C285caa701eB6"
}
},
"AaveProtocolTestHelpers": {
"LendingPool": {
"buidlerevm": {
"address": "0xe7536f450378748E1BD4645D3c77ec38e0F3ba28"
},
@ -584,7 +586,7 @@
"deployer": "0x85e4A467343c0dc4aDAB74Af84448D9c45D8ae6F"
}
},
"StableDebtToken": {
"LendingPoolConfigurator": {
"buidlerevm": {
"address": "0x830bceA96E56DBC1F8578f75fBaC0AF16B32A07d",
"deployer": "0xc783df8a850f42e7F7e57013759C285caa701eB6"
@ -602,17 +604,19 @@
"deployer": "0x85e4A467343c0dc4aDAB74Af84448D9c45D8ae6F"
}
},
"VariableDebtToken": {
"PriceOracle": {
"buidlerevm": {
"address": "0xA0AB1cB92A4AF81f84dCd258155B5c25D247b54E",
"address": "0x1750499D05Ed1674d822430FB960d5F6731fDf64",
"deployer": "0xc783df8a850f42e7F7e57013759C285caa701eB6"
},
"localhost": {
"address": "0x9bD0Bec44106D8Ea8fFb6296d7A84742a290E064",
"deployer": "0xc783df8a850f42e7F7e57013759C285caa701eB6"
},
"coverage": {
"address": "0x830bceA96E56DBC1F8578f75fBaC0AF16B32A07d",
}
},
"ChainlinkProxyPriceProvider": {
"buidlerevm": {
"address": "0x7B6C3e5486D9e6959441ab554A889099eed76290",
"deployer": "0xc783df8a850f42e7F7e57013759C285caa701eB6"
},
"kovan": {
@ -624,7 +628,14 @@
"localhost": {
"address": "0x00f126cCA2266bFb634Ed6DB17c4C74fb8cA5177",
"deployer": "0xc783df8a850f42e7F7e57013759C285caa701eB6"
},
}
},
"AaveProtocolTestHelpers": {
"buidlerevm": {
"address": "0x689d0586F88cDEa1E1003F838DD943415E4EB1e5"
}
},
"DefaultReserveInterestRateStrategy": {
"buidlerevm": {
"address": "0x5f7134cd38C826a7649f9Cc47dda24d834DD2967",
"deployer": "0xc783df8a850f42e7F7e57013759C285caa701eB6"
@ -638,7 +649,7 @@
"deployer": "0x85e4A467343c0dc4aDAB74Af84448D9c45D8ae6F"
}
},
"MockAToken": {
"StableDebtToken": {
"buidlerevm": {
"address": "0x3bDA11B584dDff7F66E0cFe1da1562c92B45db60",
"deployer": "0xc783df8a850f42e7F7e57013759C285caa701eB6"
@ -652,7 +663,7 @@
"deployer": "0xc783df8a850f42e7F7e57013759C285caa701eB6"
}
},
"WETH": {
"VariableDebtToken": {
"buidlerevm": {
"address": "0xf784709d2317D872237C4bC22f867d1BAe2913AB",
"deployer": "0xc783df8a850f42e7F7e57013759C285caa701eB6"
@ -666,7 +677,7 @@
"deployer": "0xc783df8a850f42e7F7e57013759C285caa701eB6"
}
},
"MockStableDebtToken": {
"AToken": {
"buidlerevm": {
"address": "0x392E5355a0e88Bd394F717227c752670fb3a8020",
"deployer": "0xc783df8a850f42e7F7e57013759C285caa701eB6"
@ -680,7 +691,7 @@
"deployer": "0xc783df8a850f42e7F7e57013759C285caa701eB6"
}
},
"MockVariableDebtToken": {
"MockFlashLoanReceiver": {
"buidlerevm": {
"address": "0x3b050AFb4ac4ACE646b31fF3639C1CD43aC31460",
"deployer": "0xc783df8a850f42e7F7e57013759C285caa701eB6"
@ -694,7 +705,7 @@
"deployer": "0xc783df8a850f42e7F7e57013759C285caa701eB6"
}
},
"MockSwapAdapter": {
"WalletBalanceProvider": {
"buidlerevm": {
"address": "0xDf73fC454FA018051D4a1509e63D11530A59DE10"
},

7193
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -8,6 +8,7 @@
"buidler:kovan": "buidler --network kovan",
"buidler:ropsten": "buidler--network ropsten",
"buidler:main": "buidler --network main",
"buidler:docker": "buidler --network buidlerevm_docker",
"buidler help": "buidler help",
"compile": "SKIP_LOAD=true buidler compile",
"types-gen": "typechain --target ethers-v5 --outDir ./types './artifacts/*.json'",
@ -15,6 +16,8 @@
"test-scenarios": "buidler test test/__setup.spec.ts test/scenario.spec.ts",
"aave:evm:dev:migration": "buidler aave:dev",
"aave:evm:full:migration": "buidler aave:full",
"aave:docker:dev:migration": "npm run buidler:docker -- aave:dev",
"aave:docker:full:migration": "npm run buidler:docker -- aave:full",
"aave:kovan:dev:migration": "npm run buidler:kovan -- aave:dev --verify",
"aave:kovan:full:migration": "npm run buidler:kovan -- aave:full --verify",
"aave:ropsten:dev:migration": "npm run buidler:ropsten -- aave:dev --verify",
@ -36,6 +39,7 @@
"test-liquidate": "buidler test test/__setup.spec.ts test/liquidation-atoken.spec.ts",
"test-pausable": "buidler test test/__setup.spec.ts test/pausable-functions.spec.ts",
"test-permit": "buidler test test/__setup.spec.ts test/atoken-permit.spec.ts",
"test-subgraph:scenarios": "buidler --network buidlerevm_docker test test/__setup.spec.ts test/subgraph-scenarios.spec.ts",
"dev:coverage": "buidler coverage --network coverage",
"dev:deployment": "buidler dev-deployment",
"dev:deployExample": "buidler deploy-Example",

View File

@ -0,0 +1,32 @@
import {configuration as actionsConfiguration} from './helpers/actions';
import {configuration as calculationsConfiguration} from './helpers/utils/calculations';
import BigNumber from 'bignumber.js';
import {makeSuite} from './helpers/make-suite';
import {getReservesConfigByPool} from '../helpers/configuration';
import {AavePools, iAavePoolAssets, IReserveParams} from '../helpers/types';
import {executeStory} from './helpers/scenario-engine';
makeSuite('Subgraph scenario tests', async (testEnv) => {
let story: any;
let scenario;
before('Initializing configuration', async () => {
const scenario = require(`./helpers/scenarios/borrow-repay-stable`);
story = scenario.stories[0];
// Sets BigNumber for this suite, instead of globally
BigNumber.config({DECIMAL_PLACES: 0, ROUNDING_MODE: BigNumber.ROUND_DOWN});
actionsConfiguration.skipIntegrityCheck = false; //set this to true to execute solidity-coverage
calculationsConfiguration.reservesParams = <iAavePoolAssets<IReserveParams>>(
getReservesConfigByPool(AavePools.proto)
);
});
after('Reset', () => {
// Reset BigNumber
BigNumber.config({DECIMAL_PLACES: 20, ROUNDING_MODE: BigNumber.ROUND_HALF_UP});
});
it('deposit-borrow', async () => {
await executeStory(story, testEnv);
});
});