Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
55 changes: 55 additions & 0 deletions .github/workflows/solidity-fork-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Solidity Fork Tests

on:
push:
branches:
- main
pull_request:
paths:
- 'solidity/**'
- '.github/workflows/solidity-fork-tests.yml'
schedule:
# Run daily at 6:00 UTC
- cron: '0 6 * * *'
workflow_dispatch:

concurrency:
group: solidity-fork-tests-${{ github.ref }}
cancel-in-progress: true

env:
TURBO_TELEMETRY_DISABLED: 1
TURBO_API: https://cache.depot.dev
TURBO_TOKEN: ${{ secrets.DEPOT_TURBO_TOKEN }}
TURBO_TEAM: ${{ secrets.DEPOT_ORG_ID }}

jobs:
fork-tests:
runs-on: depot-ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v5
with:
submodules: recursive

- name: Set Foundry RPC URLs for fork tests
env:
MAINNET3_ETHEREUM_RPC_URLS: ${{ secrets.MAINNET3_ETHEREUM_RPC_URLS }}
MAINNET3_OPTIMISM_RPC_URLS: ${{ secrets.MAINNET3_OPTIMISM_RPC_URLS }}
MAINNET3_POLYGON_RPC_URLS: ${{ secrets.MAINNET3_POLYGON_RPC_URLS }}
MAINNET3_ARBITRUM_RPC_URLS: ${{ secrets.MAINNET3_ARBITRUM_RPC_URLS }}
MAINNET3_BASE_RPC_URLS: ${{ secrets.MAINNET3_BASE_RPC_URLS }}
run: |
# Extract first URL from comma-separated list and set as env vars
echo "RPC_URL_MAINNET=${MAINNET3_ETHEREUM_RPC_URLS%%,*}" >> $GITHUB_ENV
echo "RPC_URL_OPTIMISM=${MAINNET3_OPTIMISM_RPC_URLS%%,*}" >> $GITHUB_ENV
echo "RPC_URL_POLYGON=${MAINNET3_POLYGON_RPC_URLS%%,*}" >> $GITHUB_ENV
echo "RPC_URL_ARBITRUM=${MAINNET3_ARBITRUM_RPC_URLS%%,*}" >> $GITHUB_ENV
echo "RPC_URL_BASE=${MAINNET3_BASE_RPC_URLS%%,*}" >> $GITHUB_ENV

- name: yarn-build
uses: ./.github/actions/yarn-build-with-cache

- name: Run Fork Tests
working-directory: ./solidity
run: yarn test:fork
6 changes: 0 additions & 6 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -161,12 +161,6 @@ jobs:
ref: ${{ github.event.pull_request.head.sha || github.sha }}
submodules: recursive

- name: Set Foundry RPC URLs for fork tests
env:
MAINNET3_ARBITRUM_RPC_URLS: ${{ secrets.MAINNET3_ARBITRUM_RPC_URLS }}
run: |
echo "FOUNDRY_RPC_URL_ARBITRUM=${MAINNET3_ARBITRUM_RPC_URLS%%,*}" >> $GITHUB_ENV

- name: yarn-build
uses: ./.github/actions/yarn-build-with-cache
with:
Expand Down
7 changes: 7 additions & 0 deletions solidity/.env.default
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Default RPC URLs for fork tests (public endpoints)
# These can be overridden by setting env vars before sourcing this file
export RPC_URL_MAINNET="${RPC_URL_MAINNET:-https://eth.merkle.io}"
export RPC_URL_OPTIMISM="${RPC_URL_OPTIMISM:-https://mainnet.optimism.io}"
export RPC_URL_POLYGON="${RPC_URL_POLYGON:-https://rpc-mainnet.matic.quiknode.pro}"
export RPC_URL_ARBITRUM="${RPC_URL_ARBITRUM:-https://arb1.arbitrum.io/rpc}"
export RPC_URL_BASE="${RPC_URL_BASE:-https://mainnet.base.org}"
1 change: 1 addition & 0 deletions solidity/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ coverage/
coverage.json
storage/
*.env
!.env.default
*lcov.info
# Foundry
out
Expand Down
10 changes: 5 additions & 5 deletions solidity/foundry.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ ignored_warnings_from = ['lib', 'test', 'contracts/test']
verbosity = 4

[rpc_endpoints]
mainnet = "https://eth.merkle.io"
optimism = "https://mainnet.optimism.io "
polygon = "https://rpc-mainnet.matic.quiknode.pro"
arbitrum = "https://arbitrum.drpc.org"
base = "https://mainnet.base.org"
mainnet = "${RPC_URL_MAINNET}"
optimism = "${RPC_URL_OPTIMISM}"
polygon = "${RPC_URL_POLYGON}"
arbitrum = "${RPC_URL_ARBITRUM}"
base = "${RPC_URL_BASE}"

[fuzz]
runs = 50
Expand Down
1 change: 1 addition & 0 deletions solidity/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@
"test:hardhat": "yarn hardhat-esm test",
"test:forge": "yarn fixtures && forge test -vvv --decode-internal --no-match-contract Everclear",
"test:ci": "yarn version:changed && yarn test:hardhat && yarn test:forge --no-match-test testFork",
"test:fork": "sh -c '. ./.env.default && forge test --match-test testFork && forge test --match-contract ForkTest'",
"gas": "forge snapshot",
"gas-ci": "yarn gas --check --tolerance 2 || (echo 'Manually update gas snapshot' && exit 1)",
"slither": "slither .",
Expand Down
2 changes: 1 addition & 1 deletion solidity/test/token/TokenBridgeCctp.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -1229,7 +1229,7 @@ contract TokenBridgeCctpV2Test is TokenBridgeCctpV1Test {

// deploy proxy code to deployer address, which is configured as recipient on cctp messages
deployCodeTo(
"../node_modules/@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol:TransparentUpgradeableProxy",
"dependencies/@openzeppelin-contracts-4.9.3/contracts/proxy/transparent/TransparentUpgradeableProxy.sol:TransparentUpgradeableProxy",
abi.encode(
address(implementation),
proxyAdmin,
Expand Down
Loading