-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
adding zk support script and makefile action
- Loading branch information
1 parent
04fb045
commit f2c6a91
Showing
3 changed files
with
105 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,7 @@ artifacts | |
cache | ||
node_modules | ||
solc | ||
zksolc | ||
abi | ||
coverage | ||
coverage.json | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -e | ||
|
||
echo " ┌──────────────────────────────────────────────┐" | ||
echo " │ Compiling CCIP contracts... │" | ||
echo " └──────────────────────────────────────────────┘" | ||
|
||
SOLC_VERSION="0.8.24" | ||
OPTIMIZE_RUNS=26000 | ||
OPTIMIZE_RUNS_OFFRAMP=500 | ||
ZKSOLC_VERSION="1.5.6" | ||
|
||
|
||
SCRIPTPATH="$( cd "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )" | ||
python3 -m pip install --require-hashes -r "$SCRIPTPATH"/requirements.txt | ||
solc-select install $SOLC_VERSION | ||
solc-select use $SOLC_VERSION | ||
export SOLC_VERSION=$SOLC_VERSION | ||
|
||
ROOT="$( cd "$(dirname "$0")" >/dev/null 2>&1 ; cd ../../ && pwd -P )" | ||
|
||
compileContract () { | ||
local contract | ||
contract=$(basename "$1" ".sol") | ||
|
||
local optimize_runs=$OPTIMIZE_RUNS | ||
|
||
case $1 in | ||
"ccip/offRamp/OffRamp.sol") | ||
echo "OffRamp uses $OPTIMIZE_RUNS_OFFRAMP optimizer runs." | ||
optimize_runs=$OPTIMIZE_RUNS_OFFRAMP | ||
;; | ||
esac | ||
|
||
solc --overwrite --optimize --optimize-runs $optimize_runs --metadata-hash none \ | ||
-o "$ROOT"/contracts/solc/v$SOLC_VERSION/"$contract" \ | ||
--abi --bin --allow-paths "$ROOT"/contracts/src/v0.8 \ | ||
--bin-runtime --hashes --metadata --metadata-literal --combined-json abi,hashes,metadata,srcmap,srcmap-runtime \ | ||
--evm-version paris \ | ||
"$ROOT"/contracts/src/v0.8/"$1" | ||
|
||
zksolc --overwrite -O3 --metadata-hash none \ | ||
-o "$ROOT"/contracts/zksolc/v$ZKSOLC_VERSION/"$contract" \ | ||
--bin --allow-paths "$ROOT"/contracts/src/v0.8 \ | ||
--metadata --metadata-literal \ | ||
--evm-version paris \ | ||
"$ROOT"/contracts/src/v0.8/"$1" | ||
} | ||
|
||
|
||
# Solc produces and overwrites intermediary contracts. | ||
# Contracts should be ordered in reverse-import-complexity-order to minimize overwrite risks. | ||
compileContract ccip/offRamp/OffRamp.sol | ||
compileContract ccip/FeeQuoter.sol | ||
compileContract ccip/onRamp/OnRamp.sol | ||
compileContract ccip/applications/PingPongDemo.sol | ||
compileContract ccip/applications/EtherSenderReceiver.sol | ||
compileContract ccip/rmn/RMNRemote.sol | ||
compileContract ccip/rmn/RMNHome.sol | ||
compileContract ccip/rmn/ARMProxy.sol | ||
compileContract ccip/MultiAggregateRateLimiter.sol | ||
compileContract ccip/Router.sol | ||
compileContract ccip/tokenAdminRegistry/TokenAdminRegistry.sol | ||
compileContract ccip/tokenAdminRegistry/RegistryModuleOwnerCustom.sol | ||
compileContract ccip/capability/CCIPHome.sol | ||
compileContract ccip/NonceManager.sol | ||
compileContract shared/token/ERC677/BurnMintERC677.sol | ||
compileContract shared/token/ERC20/BurnMintERC20.sol | ||
|
||
|
||
# Pools | ||
compileContract ccip/pools/LockReleaseTokenPool.sol | ||
compileContract ccip/pools/BurnMintTokenPool.sol | ||
compileContract ccip/pools/BurnFromMintTokenPool.sol | ||
compileContract ccip/pools/BurnWithFromMintTokenPool.sol | ||
compileContract ccip/pools/TokenPool.sol | ||
|
||
|
||
# Test helpers | ||
compileContract ccip/test/helpers/BurnMintERC677Helper.sol | ||
compileContract ccip/test/helpers/MessageHasher.sol | ||
compileContract ccip/test/helpers/USDCReaderTester.sol | ||
compileContract ccip/test/helpers/ReportCodec.sol | ||
compileContract ccip/test/helpers/receivers/MaybeRevertMessageReceiver.sol | ||
compileContract ccip/test/helpers/MultiOCR3Helper.sol | ||
compileContract ccip/test/mocks/MockE2EUSDCTokenMessenger.sol | ||
compileContract ccip/test/mocks/MockE2EUSDCTransmitter.sol | ||
compileContract ccip/test/WETH9.sol | ||
compileContract ccip/test/helpers/CCIPReaderTester.sol | ||
|
||
# Encoding Utils | ||
compileContract ccip/interfaces/encodingutils/ICCIPEncodingUtils.sol | ||
|
||
# Customer contracts | ||
compileContract ccip/pools/USDC/USDCTokenPool.sol | ||
|
||
compileContract tests/MockV3Aggregator.sol |