Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
a38119b
fix: add 2 missing values to .env.example (#195)
uri-99 Mar 26, 2024
8484591
fix: race condition on zksync tests (#199)
uri-99 Mar 27, 2024
529c248
feat (starknet): add batching functionality for claim_payment (#184)
taturosati Mar 27, 2024
db0b127
fix: add origin_network to Error model (#205)
JuArce Mar 27, 2024
068fd33
docs: improve mm deploy instructions (#202)
JuArce Mar 28, 2024
3a87386
perf: implement only calculate keccak value in transfer-claim (#183)
uri-99 Apr 2, 2024
b5c2dad
fix(mm): add tabs to deps recipe (#209)
NicolasRampoldi Apr 3, 2024
f7a97ba
hotfix: run cicd on pushes to develop (#212)
JuArce Apr 3, 2024
5ae6f6e
feat (zksync): add batching functionality for claim payment (#198)
taturosati Apr 3, 2024
4e71ed3
feat: added make starknet-connect target (#216)
uri-99 Apr 3, 2024
fec3166
refactor: move starknet scripts to their own scripts folder (#217)
uri-99 Apr 4, 2024
1d8d327
test: add claim payment unit tests for zksync (#218)
uri-99 Apr 4, 2024
464fac8
chore(mm): update web3 version from 6.5.0 to 6.10.0 (#220)
NicolasRampoldi Apr 4, 2024
5d72d28
refactor: correctly set claim payment selectors on PaymentRegistry in…
uri-99 Apr 5, 2024
6d78ca5
refactor: use canonic chains ids in paymentregistry (#219)
uri-99 Apr 5, 2024
14a6934
docs: add zksync documentation (#197)
uri-99 Apr 5, 2024
5523bfe
fix: change mm bot python version to 310 (#223)
uri-99 Apr 9, 2024
dd5c919
refactor: claimPayment to claimPaymentStarknet (#225)
uri-99 Apr 9, 2024
7fa7c9a
chore(mm-bot): add indexes to database (#229)
NicolasRampoldi Apr 11, 2024
1450dd8
remove: comment //TODO: change orderID to uint32 (#233)
uri-99 Apr 12, 2024
65ed114
chore(mm bot): save from address from set order events (#235)
NicolasRampoldi Apr 15, 2024
c54a60c
feat(mm bot): add long range orders processor for zksync (#238)
NicolasRampoldi Apr 15, 2024
d02bee1
feat(mm bot): add initialize blocks function (#240)
NicolasRampoldi Apr 15, 2024
848a177
fix (mm-bot): estimate zksync message fee & gas limit (#241)
taturosati Apr 16, 2024
c57b125
chore: update claim payment fees (#243)
JuArce Apr 18, 2024
1900604
docs: update mm documentation (#236)
JuArce Apr 19, 2024
b93aa64
build: implement integration test for zksync contracts (#227)
uri-99 Apr 19, 2024
e49abb5
feat: created zksync-test test CI template file
uri-99 Apr 19, 2024
c8256c1
Merge remote-tracking branch 'origin/develop' into 245-build-add-zksy…
uri-99 Apr 19, 2024
30ccbdc
feat: do zksync unit test with in-memory node
uri-99 Apr 19, 2024
aa083af
refactor: action name
uri-99 Apr 19, 2024
73fa1b4
fix: add sleep for in-memory-node setup
uri-99 Apr 19, 2024
fda7c6d
refactor: zksync unit test execution in ci
uri-99 Apr 19, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/eth-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
push:
branches:
- main
- develop
pull_request:
types: [opened, synchronize, reopened]

Expand Down
12 changes: 9 additions & 3 deletions .github/workflows/integration-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ on:
push:
branches:
- main
- develop
pull_request:
types: [opened, synchronize, reopened]
workflow_dispatch:
Expand Down Expand Up @@ -149,7 +150,7 @@ jobs:
run: |
make starknet-build

# Deploy PaymentRegistry, Escrow, set escrow, set claimPayment selector and test complete flow
# Deploy PaymentRegistry, Escrow, set escrow, and test complete flow
- name: Deploy and test complete flow
run: |
export ETHEREUM_RPC=${{vars.ETHEREUM_RPC}}
Expand All @@ -158,15 +159,20 @@ jobs:
export STARKNET_MESSAGING_ADDRESS=${{vars.STARKNET_MESSAGING_ADDRESS}}
export MM_ETHEREUM_WALLET_ADDRESS=${{vars.MM_ETHEREUM_WALLET_ADDRESS}}
export ZKSYNC_DIAMOND_PROXY_ADDRESS=${{vars.ZKSYNC_DIAMOND_PROXY_ADDRESS}}
export STARKNET_CHAIN_ID=${{vars.STARKNET_CHAIN_ID}}
export ZKSYNC_CHAIN_ID=${{vars.ZKSYNC_CHAIN_ID}}
export STARKNET_CLAIM_PAYMENT_SELECTOR=${{vars.STARKNET_CLAIM_PAYMENT_SELECTOR}}
export STARKNET_CLAIM_PAYMENT_BATCH_SELECTOR=${{vars.STARKNET_CLAIM_PAYMENT_BATCH_SELECTOR}}
export ZKSYNC_CLAIM_PAYMENT_SELECTOR=${{vars.ZKSYNC_CLAIM_PAYMENT_SELECTOR}}
export ZKSYNC_CLAIM_PAYMENT_BATCH_SELECTOR=${{vars.ZKSYNC_CLAIM_PAYMENT_BATCH_SELECTOR}}
export SKIP_VERIFY=true
. ./contracts/ethereum/deploy.sh

export STARKNET_RPC=${{vars.STARKNET_RPC}}
source ./contracts/starknet/.env.test
. ./contracts/starknet/deploy.sh
. ./contracts/starknet/scripts/deploy.sh

. ./contracts/ethereum/set_starknet_escrow.sh
. ./contracts/ethereum/set_starknet_claim_payment_selector.sh

export AMOUNT=1000000000000000000
. ./.github/workflows/scripts/set_order.sh
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/katana/katana.env
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
ACCOUNT_ADDRESS=0x517ececd29116499f4a1b64b094da79ba08dfd54a3edaa316134c41f8160973
ACCOUNT_PRIVATE_KEY=0x1800000000300000180000000000030000000000003006001800006600
ACCOUNT_SRC=/home/runner/.config/.starkli/account_katana.json
RPC_URL=http://0.0.0.0:5050
RPC_URL=http://0.0.0.0:5050
4 changes: 2 additions & 2 deletions .github/workflows/scripts/claim_payment.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

DESTINATION_ADDRESS=0x70997970C51812dc3A010C7d01b50e0d17dc79C8

echo -e "${GREEN}\n=> [SN] Making ClaimPayment${COLOR_RESET}" # 0x70997970C51812dc3A010C7d01b50e0d17dc79C8 -> 642829559307850963015472508762062935916233390536
echo -e "${GREEN}\n=> [SN] Making ClaimPaymentStarknet${COLOR_RESET}" # 0x70997970C51812dc3A010C7d01b50e0d17dc79C8 -> 642829559307850963015472508762062935916233390536

ESCROW_INITIAL_BALANCE=$(starkli balance $ESCROW_CONTRACT_ADDRESS)
MM_INITIAL_BALANCE=$(starkli balance $MM_STARKNET_WALLET_ADDRESS)
Expand All @@ -13,7 +13,7 @@ echo "Initial MM balance: $MM_INITIAL_BALANCE"

echo "Withdrawing $AMOUNT"
cast send --rpc-url $ETHEREUM_RPC --private-key $ETHEREUM_PRIVATE_KEY \
$PAYMENT_REGISTRY_PROXY_ADDRESS "claimPayment(uint256, uint256, uint256)" \
$PAYMENT_REGISTRY_PROXY_ADDRESS "claimPaymentStarknet(uint256, address, uint256)" \
"0" $DESTINATION_ADDRESS "$AMOUNT" \
--value $AMOUNT >> /dev/null

Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/scripts/transfer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
. contracts/utils/colors.sh #for ANSI colors

DESTINATION_ADDRESS=0x70997970C51812dc3A010C7d01b50e0d17dc79C8
STARKNET_CHAIN_ID="0"

echo -e "${GREEN}\n=> [SN] Making transfer to Destination account${COLOR_RESET}" # 0x70997970C51812dc3A010C7d01b50e0d17dc79C8 -> 642829559307850963015472508762062935916233390536

Expand All @@ -14,7 +13,7 @@ echo "Initial Destination balance: $DESTINATION_INITIAL_BALANCE"

echo "Transferring $AMOUNT to $DESTINATION_ADDRESS"
cast send --rpc-url $ETHEREUM_RPC --private-key $ETHEREUM_PRIVATE_KEY \
$PAYMENT_REGISTRY_PROXY_ADDRESS "transfer(uint256, uint256, uint8)" \
$PAYMENT_REGISTRY_PROXY_ADDRESS "transfer(uint256, address, uint128)" \
"0" $DESTINATION_ADDRESS $STARKNET_CHAIN_ID \
--value $AMOUNT >> /dev/null

Expand Down
1 change: 1 addition & 0 deletions .github/workflows/sn-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
push:
branches:
- main
- develop
pull_request:
types: [opened, synchronize, reopened]

Expand Down
97 changes: 97 additions & 0 deletions .github/workflows/zksync-integration-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
name: ZKSync Integration Test
on:
push:
branches:
- main
- develop
pull_request:
types: [opened, synchronize, reopened]
workflow_dispatch:

defaults:
run:
shell: bash

jobs:
Test:
runs-on: ubuntu-latest
environment: Test

steps:
- uses: actions/checkout@v4

# Run Dockerized L1-L2, goes first because it takes a lot of time
- name: Setup Dockerized L1-L2
run: |
export ETHERSCAN_API_KEY=${{vars.ETHERSCAN_API_KEY}}
git clone https://github.com/uri-99/zksync-local-setup.git

echo git cloned
cd zksync-local-setup

echo starting Dockerized L1-L2
touch ../docker_output.log
./start.sh &> ../docker_output.log &

# Ethereum Setup
- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1

- name: Install Forge
run: |
cd contracts/ethereum
forge install

# ZKSync Setup
- name: Install ZKSync libraries
run: |
cd ./contracts/zksync/ && yarn install

- name: Setup Node
uses: actions/setup-node@v2
with:
node-version: '20.11.1'
cache: 'npm'
cache-dependency-path: '**/.github/workflows/*.yml'

- name: Download zksync-cli
run: |
npx zksync-cli --version

# Build Ethereum Contract
- name: Build Ethereum Contract
run: |
make ethereum-build

# Build ZKSync Contract
- name: Build ZKSync Contract
run: |
make zksync-build

# Run Dockerized L1-L2
- name: Running integration test
run: |
export ETHERSCAN_API_KEY=${{vars.ETHERSCAN_API_KEY}}

export STARKNET_MESSAGING_ADDRESS=${{vars.STARKNET_MESSAGING_ADDRESS}}
export STARKNET_CLAIM_PAYMENT_SELECTOR=${{vars.STARKNET_CLAIM_PAYMENT_SELECTOR}}
export STARKNET_CLAIM_PAYMENT_BATCH_SELECTOR=${{vars.STARKNET_CLAIM_PAYMENT_BATCH_SELECTOR}}
export ZKSYNC_CLAIM_PAYMENT_SELECTOR=${{vars.ZKSYNC_CLAIM_PAYMENT_SELECTOR}}
export ZKSYNC_CLAIM_PAYMENT_BATCH_SELECTOR=${{vars.ZKSYNC_CLAIM_PAYMENT_BATCH_SELECTOR}}
export STARKNET_CHAIN_ID=${{vars.STARKNET_CHAIN_ID}}
export ZKSYNC_CHAIN_ID=${{vars.ZKSYNC_CHAIN_ID}}

export MM_ETHEREUM_WALLET_ADDRESS=${{vars.MM_ETHEREUM_WALLET_ADDRESS}}
export TEST=true

echo sleeping 250 to wait for ./start to setup
sleep 250

export ZKSYNC_DIAMOND_PROXY_ADDRESS=$(cat docker_output.log | sed -n 's/.*CONTRACTS_DIAMOND_PROXY_ADDR=\(0x[a-fA-F0-9]*\).*/\1/p')
echo stored ZKSYNC_DIAMOND_PROXY_ADDRESS variable:
echo $ZKSYNC_DIAMOND_PROXY_ADDRESS

echo running make-test-integration-ci
make zksync-test-integration-ci

exit 0
29 changes: 29 additions & 0 deletions .github/workflows/zksync-scripts/assert.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/bin/bash

. contracts/utils/colors.sh #for ANSI colors

echo "\n"
FAILED=false

assert() {
#Usage: assert <variable_name> <obtained> <expected>
if [ $2 = $3 ] ; then
printf "${GREEN}✓ $1 passed.${RESET}\n"
else
printf "${RED}x $1 assertion failed: Obtained value: $2, Expected value: $3.${RESET}\n"
FAILED=true
fi
}

assert "Escrow balance after SetOrder" $BALANCE_ESCROW_L2_AFTER_SETORDER_WEI $VALUE_WEI #2000000000000000000
assert "Escrow balance after Claim Payment" $BALANCE_ESCROW_L2_AFTER_CLAIMPAYMENT_WEI 0

assert "User balance" $BALANCE_USER_L1_AFTER_TRANSFER_WEI $BRIDGE_AMOUNT_WEI #1990000000000000000

assert "MM balance" $(($BALANCE_MM_L2_AFTER_CLAIMPAYMENT_WEI)) $(($BALANCE_MM_L2_BEFORE_CLAIMPAYMENT_WEI + $VALUE_WEI))

if $FAILED; then
echo "One of the previous tests failed, all should pass for Integration Test to be successful"
exit 1
fi
exit 0
36 changes: 36 additions & 0 deletions .github/workflows/zksync-scripts/ci.env.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
## ETH.env
SKIP_VERIFY=true #cant verify on local devnet

ETHEREUM_RPC=http://localhost:8545 #local devnet L1 rpc url

ETHEREUM_PRIVATE_KEY=0x7726827caac94a7f9e1b160f7ea819f172f7b6f9d2a97f992c38edeab82d4110 #prefunded 0

MM_ETHEREUM_PRIVATE_KEY=0xd293c684d884d56f8d6abd64fc76757d3664904e309a0645baf8522ab6366d9e #prefunded 2
MM_ETHEREUM_WALLET_ADDRESS=0x0D43eB5B8a47bA8900d84AA36656c92024e9772e #prefunded 2

USER_ETHEREUM_PUBLIC_ADDRESS=0xCEEe57f2B700c2f37D1476A7974965E149Fce2D4 #random address with no funds

ZKSYNC_CLAIM_PAYMENT_SELECTOR=0xa5168739
ZKSYNC_CLAIM_PAYMENT_BATCH_SELECTOR=0x156be1ae
ZKSYNC_CHAIN_ID=300


# These SN variables don't affect this test, but are necessary for deploy
STARKNET_CLAIM_PAYMENT_SELECTOR=0x03636c566f6409560d55d5f6d1eb4ee163b096b4698c503e69e210be79de2afa
STARKNET_CLAIM_PAYMENT_BATCH_SELECTOR=0x0354a01e49fe07e43306a97ed84dbd5de8238c7d8ff616caa3444630cfc559e6
STARKNET_MESSAGING_ADDRESS=0xE2Bb56ee936fd6433DC0F6e7e3b8365C906AA057
STARKNET_CHAIN_ID=0x534e5f5345504f4c4941


## ZKSYNC.env
TEST=true

WALLET_PRIVATE_KEY=0x7726827caac94a7f9e1b160f7ea819f172f7b6f9d2a97f992c38edeab82d4110 #prefunded 0
MM_ZKSYNC_WALLET=0xbE85c9531BE760B6964cdA4A8826b9Cb0391E32C #random address with no funds

NATIVE_TOKEN_ETH_IN_ZKSYNC=0x000000000000000000000000000000000000800A

USER_ZKSYNC_PRIVATE_ADDRESS=0xf12e28c0eb1ef4ff90478f6805b68d63737b7f33abfa091601140805da450d93 #prefunded 4
USER_ZKSYNC_PUBLIC_ADDRESS=0x8002cD98Cfb563492A6fB3E7C8243b7B9Ad4cc92 #prefunded 4


26 changes: 26 additions & 0 deletions .github/workflows/zksync-scripts/claim_payment.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/bin/bash

. contracts/utils/colors.sh #for ANSI colors

printf "${GREEN}\n=> [ETH] Making Claim Payment${COLOR_RESET}\n"

BALANCE_ESCROW_L2_BEFORE_CLAIMPAYMENT=$(cast balance --rpc-url http://localhost:3050 $ZKSYNC_ESCROW_CONTRACT_ADDRESS)
echo "Initial Escrow balance: $BALANCE_ESCROW_L2_BEFORE_CLAIMPAYMENT"

BALANCE_MM_L2_BEFORE_CLAIMPAYMENT_WEI=$(cast balance --rpc-url http://localhost:3050 $MM_ZKSYNC_WALLET) #for assert.sh
BALANCE_MM_L2_BEFORE_CLAIMPAYMENT=$(cast balance --rpc-url http://localhost:3050 --ether $MM_ZKSYNC_WALLET) #for logging
echo "Initial MM balance: $BALANCE_MM_L2_BEFORE_CLAIMPAYMENT"

echo "Withdrawing $BRIDGE_AMOUNT_ETH ETH" # == $BRIDGE_AMOUNT_WEI WEI"
cast send --rpc-url $ETHEREUM_RPC --private-key $ETHEREUM_PRIVATE_KEY --gas-price 2000000000 \
$PAYMENT_REGISTRY_PROXY_ADDRESS "claimPaymentZKSync(uint256, address, uint256, uint256, uint256)" \
"0" $USER_ETHEREUM_PUBLIC_ADDRESS $BRIDGE_AMOUNT_WEI 2000000 800 \
--value 5000000000000000000 > /dev/null

BALANCE_ESCROW_L2_AFTER_CLAIMPAYMENT_WEI=$(cast balance --rpc-url http://localhost:3050 $ZKSYNC_ESCROW_CONTRACT_ADDRESS) #for assert.sh
BALANCE_ESCROW_L2_AFTER_CLAIMPAYMENT=$(cast balance --rpc-url http://localhost:3050 --ether $ZKSYNC_ESCROW_CONTRACT_ADDRESS) #for logging
echo "Final Escrow balance: $BALANCE_ESCROW_L2_AFTER_CLAIMPAYMENT"

BALANCE_MM_L2_AFTER_CLAIMPAYMENT_WEI=$(cast balance --rpc-url http://localhost:3050 $MM_ZKSYNC_WALLET) #for assert.sh
BALANCE_MM_L2_AFTER_CLAIMPAYMENT=$(cast balance --rpc-url http://localhost:3050 --ether $MM_ZKSYNC_WALLET) #for logging
echo "Final MM balance:$BALANCE_MM_L2_AFTER_CLAIMPAYMENT"
33 changes: 33 additions & 0 deletions .github/workflows/zksync-scripts/set_order.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#!/bin/bash

. contracts/utils/colors.sh #for ANSI colors

FEE=10000000000000000 #in WEI
VALUE=2 #in ETH
VALUE_WEI=$(echo "scale=0; $VALUE * 10^18" | bc)
BRIDGE_AMOUNT_WEI=$(echo "scale=0; $VALUE_WEI - $FEE" | bc)
BRIDGE_AMOUNT_ETH=$(echo "scale=18; $BRIDGE_AMOUNT_WEI / 10^18" | bc)

echo USER_ZKSYNC_PUBLIC_ADDRESS
echo $USER_ZKSYNC_PUBLIC_ADDRESS
echo ZKSYNC_ESCROW_CONTRACT_ADDRESS
echo $ZKSYNC_ESCROW_CONTRACT_ADDRESS

printf "${GREEN}\n=> [SN] Making Set Order on Escrow${COLOR_RESET}\n"
echo "$ZKSYNC_ESCROW_CONTRACT_ADDRESS\n"

BALANCE_USER_L2_BEFORE_SETORDER=$(cast balance --rpc-url http://localhost:3050 $USER_ZKSYNC_PUBLIC_ADDRESS)
echo "Initial User funds: $BALANCE_USER_L2_BEFORE_SETORDER"

BALANCE_ESCROW_L2_BEFORE_SETORDER=$(cast balance --rpc-url http://localhost:3050 $ZKSYNC_ESCROW_CONTRACT_ADDRESS)
echo "Initial Escrow funds: $BALANCE_ESCROW_L2_BEFORE_SETORDER"

npx zksync-cli contract write --private-key $USER_ZKSYNC_PRIVATE_ADDRESS --rpc http://localhost:3050 --contract "$ZKSYNC_ESCROW_CONTRACT_ADDRESS" --method "set_order(address recipient_address, uint256 fee)" --args "$USER_ETHEREUM_PUBLIC_ADDRESS" "$FEE" --value "$VALUE" >> /dev/null

BALANCE_USER_L2_AFTER_SETORDER=$(cast balance --rpc-url http://localhost:3050 $USER_ZKSYNC_PUBLIC_ADDRESS)
echo "Final User funds: $BALANCE_USER_L2_AFTER_SETORDER"


BALANCE_ESCROW_L2_AFTER_SETORDER_WEI=$(cast balance --rpc-url http://localhost:3050 $ZKSYNC_ESCROW_CONTRACT_ADDRESS) #for assert.sh
BALANCE_ESCROW_L2_AFTER_SETORDER=$(cast balance --rpc-url http://localhost:3050 $ZKSYNC_ESCROW_CONTRACT_ADDRESS) #for logging
echo "Final Escrow funds:$BALANCE_ESCROW_L2_AFTER_SETORDER"
24 changes: 24 additions & 0 deletions .github/workflows/zksync-scripts/transfer.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/bin/bash

. contracts/utils/colors.sh #for ANSI colors

printf "${GREEN}\n=> [ETH] Making transfer to Destination account${COLOR_RESET}\n"

BALANCE_MM_L1_BEFORE_TRANSFER=$(cast balance --rpc-url $ETHEREUM_RPC $MM_ETHEREUM_WALLET_ADDRESS)
echo "Initial MM Balance: $BALANCE_MM_L1_BEFORE_TRANSFER"

BALANCE_USER_L1_BEFORE_TRANSFER=$(cast balance --rpc-url $ETHEREUM_RPC $USER_ETHEREUM_PUBLIC_ADDRESS)
echo "Initial User Balance: $BALANCE_USER_L1_BEFORE_TRANSFER"

echo "Transferring $BRIDGE_AMOUNT_ETH ETH to $USER_ETHEREUM_PUBLIC_ADDRESS"
cast send --rpc-url $ETHEREUM_RPC --private-key $MM_ETHEREUM_PRIVATE_KEY --gas-price 2000000000 \
$PAYMENT_REGISTRY_PROXY_ADDRESS "transfer(uint256, address, uint128)" \
"0" $USER_ETHEREUM_PUBLIC_ADDRESS $ZKSYNC_CHAIN_ID \
--value $BRIDGE_AMOUNT_WEI >> /dev/null

BALANCE_MM_L1_AFTER_TRANSFER=$(cast balance --rpc-url $ETHEREUM_RPC $MM_ETHEREUM_WALLET_ADDRESS)
echo "Final MM Balance: $BALANCE_MM_L1_AFTER_TRANSFER"

BALANCE_USER_L1_AFTER_TRANSFER_WEI=$(cast balance --rpc-url $ETHEREUM_RPC $USER_ETHEREUM_PUBLIC_ADDRESS) #for assert.sh
BALANCE_USER_L1_AFTER_TRANSFER=$(cast balance --rpc-url $ETHEREUM_RPC --ether $USER_ETHEREUM_PUBLIC_ADDRESS) #for logging
echo "Final User Balance: $BALANCE_USER_L1_AFTER_TRANSFER"
46 changes: 46 additions & 0 deletions .github/workflows/zksync-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: ZKSync Escrow Tests

on:
push:
branches:
- main
- develop
pull_request:
types: [opened, synchronize, reopened]

jobs:
test-ZKSync:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

# ZKSync Setup
- name: Install ZKSync libraries
run: |
cd ./contracts/zksync/ && yarn install

- name: Setup Node
uses: actions/setup-node@v2
with:
node-version: '20.11.1'
cache: 'npm'
cache-dependency-path: '**/.github/workflows/*.yml'

- name: Download zksync-cli
run: |
npx zksync-cli --version

# Build ZKSync Contract
- name: Build ZKSync Contract
run: |
make zksync-build

- name: Run make zksync-test
run: |
echo "Starting ZKSync in-memory node"
npx zksync-cli dev start
echo sleeping 30 for in-memory-node setup
sleep 30
make zksync-test-in-memory

exit 0
Loading