Skip to content

docs: remove docs completely, migrate them to zksync-era #6732

docs: remove docs completely, migrate them to zksync-era

docs: remove docs completely, migrate them to zksync-era #6732

name: L1 contracts foundry CI
env:
ANVIL_PRIVATE_KEY: "0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80"
ANVIL_RPC_URL: "http://127.0.0.1:8545"
on:
pull_request:
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout the repository
uses: actions/checkout@v4
with:
submodules: true
- name: Install foundry-zksync
run: |
mkdir ./foundry-zksync
curl -LO https://github.com/matter-labs/foundry-zksync/releases/download/nightly-ae913af65381734ad46c044a9495b67310bc77c4/foundry_nightly_linux_amd64.tar.gz
tar zxf foundry_nightly_linux_amd64.tar.gz -C ./foundry-zksync
chmod +x ./foundry-zksync/forge ./foundry-zksync/cast
echo "$PWD/foundry-zksync" >> $GITHUB_PATH
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: 18.18.0
cache: yarn
- name: Install dependencies
run: yarn
- name: Build artifacts
run: yarn l1 build:foundry
- name: Build system-contract artifacts
run: yarn sc build:foundry
- name: Build l2 artifacts
run: yarn l2 build:foundry
- name: Build da-contracts artifacts
run: yarn da build:foundry
- name: Create cache
uses: actions/cache/save@v4
with:
key: artifacts-l1-contracts-foudry-${{ github.sha }}
path: |
da-contracts/out
l1-contracts/cache-forge
l1-contracts/out
l1-contracts/zkout
l2-contracts/cache-forge
l2-contracts/zkout
system-contracts/zkout
scripts:
runs-on: ubuntu-latest
needs: build
steps:
- name: Checkout the repository
uses: actions/checkout@v4
with:
submodules: true
- name: Restore artifacts cache
uses: actions/cache/restore@v3
with:
fail-on-cache-miss: true
key: artifacts-l1-contracts-foudry-${{ github.sha }}
path: |
da-contracts/out
l1-contracts/cache-forge
l1-contracts/out
l1-contracts/zkout
l2-contracts/cache-forge
l2-contracts/zkout
system-contracts/zkout
- name: Use Foundry
uses: foundry-rs/foundry-toolchain@v1
- name: Copy configs from template
working-directory: ./l1-contracts
run: cp -r deploy-script-config-template/. script-config
- name: Run anvil
run: |
anvil --silent &
ANVIL_READY=0
for i in {1..10}; do
if curl -s -o /dev/null $ANVIL_RPC_URL -X POST -H "Content-Type: application/json" -d '{"jsonrpc":"2.0","method":"eth_chainId","id":1}'; then
echo "Anvil is ready"
ANVIL_READY=1
break
else
echo "Waiting for Anvil to become ready..."
sleep 1
fi
done
if [ $ANVIL_READY -ne 1 ]; then
echo "Anvil failed to become ready after 10 attempts."
exit 1
fi
- name: Run DeployL1CoreContracts script
working-directory: ./l1-contracts
# First we need to deploy the ecosystem contracts
run: forge script ./deploy-scripts/DeployL1CoreContracts.s.sol --ffi --rpc-url $ANVIL_RPC_URL --broadcast --private-key $ANVIL_PRIVATE_KEY --skip '*/l1-contracts/contracts/*'
- name: Read bridgehub proxy address
id: read-bridgehub
working-directory: ./l1-contracts
run: |
# Extract bridgehub_proxy_addr allowing leading whitespace
BRIDGEHUB=$(
sed -nE 's/^[[:space:]]*bridgehub_proxy_addr[[:space:]]*=[[:space:]]*"([^"]+)".*/\1/p' \
./script-out/output-deploy-l1.toml | head -n1
)
echo "Parsed bridgehub_proxy_addr: $BRIDGEHUB"
if [[ -z "$BRIDGEHUB" || ! "$BRIDGEHUB" =~ ^0x[0-9a-fA-F]{40}$ ]]; then
echo "❌ Failed to parse a valid bridgehub address"
exit 1
fi
echo "BRIDGEHUB=$BRIDGEHUB" >> $GITHUB_ENV
- name: Run DeployCTM script with bridgehub
working-directory: ./l1-contracts
run: |
forge script ./deploy-scripts/DeployCTM.s.sol \
--ffi \
--rpc-url $ANVIL_RPC_URL \
--broadcast \
--private-key $ANVIL_PRIVATE_KEY \
--sig "runWithBridgehub(address,bool)" $BRIDGEHUB "false" \
--skip '*/l1-contracts/contracts/*'
- name: Run DeployErc20 script
working-directory: ./l1-contracts
run: forge script ./deploy-scripts/DeployErc20.s.sol --ffi --rpc-url $ANVIL_RPC_URL --broadcast --private-key $ANVIL_PRIVATE_KEY
# TODO restore scripts verification
# - name: Run RegisterZKChain script
# working-directory: ./l1-contracts
# run: |
# cat ./script-out/output-deploy-l1.toml >> ./script-config/register-zk-chain.toml
# forge script ./deploy-scripts/RegisterZKChain.s.sol --ffi --rpc-url $ANVIL_RPC_URL --broadcast --private-key $ANVIL_PRIVATE_KEY
# - name: Run InitializeL2WethToken script
# working-directory: ./l1-contracts-foundry
# run: forge script ./deploy-scripts/InitializeL2WethToken.s.sol --ffi --rpc-url $ANVIL_RPC_URL --broadcast --private-key $ANVIL_PRIVATE_KEY