@@ -5,13 +5,16 @@ set -euo pipefail -x
55VERSION=" $( jq -r .version contracts/package.json) "
66DIRNAME=" $( dirname -- " ${BASH_SOURCE[0]} " ) "
77
8+ # Apply patch to contracts that are transpiled
89bash " $DIRNAME /patch-apply.sh"
910sed -i' ' -e " s/<package-version>/$VERSION /g" " contracts/package.json"
1011git add contracts/package.json
1112
13+ # Build artifacts
1214npm run clean
1315npm run compile
1416
17+ # Check artifacts are correctly built
1518build_info=($( jq -r ' .input.sources | keys | if any(test("^contracts/mocks/.*\\bunreachable\\b")) then empty else input_filename end' artifacts/build-info/* ) )
1619build_info_num=${# build_info[@]}
1720
@@ -20,10 +23,13 @@ if [ $build_info_num -ne 1 ]; then
2023 exit 1
2124fi
2225
26+ # Apply changes to the excluded contracts (these don't need to in the artifact and may prevent compilation)
27+ git apply -3 " $DIRNAME /upgradeable.excluded.patch"
28+
2329# -D: delete original and excluded files
2430# -b: use this build info file
2531# -i: use included Initializable
26- # -x: exclude proxy-related contracts with a few exceptions
32+ # -x: exclude vendored and proxy-related contracts with a few exceptions
2733# -p: emit public initializer
2834# -n: use namespaces
2935# -N: exclude from namespaces transformation
@@ -38,6 +44,8 @@ npx @openzeppelin/upgrade-safe-transpiler -D \
3844 -x ' !contracts/proxy/ERC1967/ERC1967Utils.sol' \
3945 -x ' !contracts/proxy/utils/UUPSUpgradeable.sol' \
4046 -x ' !contracts/proxy/beacon/IBeacon.sol' \
47+ -x ' contracts/vendor/**/*' \
48+ -x ' !contracts/vendor/compound/ICompoundTimelock.sol' \
4149 -p ' contracts/access/manager/AccessManager.sol' \
4250 -p ' contracts/finance/VestingWallet.sol' \
4351 -p ' contracts/governance/TimelockController.sol' \
0 commit comments