-
Notifications
You must be signed in to change notification settings - Fork 584
/
setup-test-env.sh
42 lines (34 loc) · 1.28 KB
/
setup-test-env.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#!/bin/bash
# @dev
# This bash script setups the needed artifacts to use
# the @aave/deploy-v3 package as source of deployment
# scripts for testing or coverage purposes.
#
# A separate artifacts directory was created
# due at running tests all external artifacts
# located at /artifacts are deleted, causing
# the deploy library to not find the external
# artifacts.
echo "[BASH] Setting up testnet environment"
if [ ! "$COVERAGE" = true ]; then
# remove hardhat and artifacts cache
npm run ci:clean
# compile @aave/core-v3 contracts
npm run compile
else
echo "[BASH] Skipping compilation to keep coverage artifacts"
fi
# Copy artifacts into separate directory to allow
# the hardhat-deploy library load all artifacts without duplicates
mkdir -p temp-artifacts
cp -r artifacts/* temp-artifacts
# Import external @aave/periphery artifacts
mkdir -p temp-artifacts/periphery
cp -r node_modules/@aave/periphery-v3/artifacts/contracts/* temp-artifacts/periphery
# Import external @aave/deploy artifacts
mkdir -p temp-artifacts/deploy
cp -r node_modules/@aave/deploy-v3/artifacts/contracts/* temp-artifacts/deploy
# Export MARKET_NAME variable to use Aave market as testnet deployment setup
export MARKET_NAME="Test"
export ENABLE_REWARDS="false"
echo "[BASH] Testnet environment ready"