Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

[IMPROVEMENT] Make E2E Tests Resilient to Foundry Version Differences

オープン
#78 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
38/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
shell, solidity

調査の方向性

Start by reading local/punchswap/e2e_punchswap.sh and solidity/script/02_DeployUSDC_WBTC_Create2.s.sol to trace how token addresses are predicted and used. Then inspect local/punchswap/punchswap.env and solidity/script/03_UseMintedUSDCWBTC_AddLPAndSwap.s.sol for the configured addresses and strategy initialization. Done means the E2E flow uses addresses that match deployed tokens across supported Foundry versions; the issue also proposes documenting the tested version in the README.

索引モデルが issue の本文から書いたものです。

説明

Issue to be solved

When running the e2e test script (e2e_punchswap.sh), the predicted addresses of USDC and WBTC tokens differ depending on the Foundry version installed locally. This address mismatch causes:

  1. E2E tests to fail or not complete successfully
  2. FlowVaultsStrategies contract to be initialized with hardcoded addresses (e.g., 0xaCCF0c4EeD4438Ad31Cd340548f4211a465B6528) that don't actually have ERC20 tokens deployed at them
  3. Runtime interaction failures when working with the emulator because strategies reference non-existent token contracts
Current Behavior

The deployment script 02_DeployUSDC_WBTC_Create2.s.sol uses Foundry's CREATE2 deployer to predict token addresses:

address predictedUSDC = _predict(CREATE2_DEPLOYER, SALT_USDC, usdcInit);
address predictedWBTC = _predict(CREATE2_DEPLOYER, SALT_WBTC, wbtcInit);

These predicted addresses are then:

  • Used as configuration values in punchswap.env:
    • USDC_ADDR=0xaCCF0c4EeD4438Ad31Cd340548f4211a465B6528
    • WBTC_ADDR=0x374BF2423c6b67694c068C3519b3eD14d3B0C5d1
  • Passed as initialization arguments when deploying FlowVaultsStrategies

However, different Foundry versions appear to generate different predicted addresses for the same deployment parameters, breaking the entire deployment and testing flow.

Impact
  • Test Reliability: E2E tests are not reproducible across different development environments
  • Configuration Mismatch: Hard-coded addresses in punchswap.env don't have actual ERC20 tokens deployed at them when Foundry versions differ
  • Deployment Failures: FlowVaultsStrategies contracts are initialized with addresses that point to empty/non-token contracts, causing all token interactions to fail
  • Team Coordination: Different team members may experience different test results based on their local Foundry installation
Suggest A Solution
Inform Foundry Version to be used locally

Technical Implementation:

  • Document the working Foundry version in README:

    This project has been tested with:
    forge Version: 1.4.3-v1.4.3
    Commit SHA: fa9f934bdac4bcf57e694e852a61997dda90668a
    Build Timestamp: 2025-10-22T04:37:38.758664000Z
    Build Profile: maxperf
    

    To install this specific version:

    foundryup --version nightly-fa9f934bdac4bcf57e694e852a61997dda90668a
    

Tradeoffs:

  • ✅ Simple to implement
  • ✅ Provides clear guidance to developers
  • ❌ Relies on developers manually checking and installing correct version
  • ❌ No automated enforcement

Caveats and Considerations for the Future

  1. CI/CD Integration: Whichever solution is chosen should work seamlessly in GitHub Actions and other automated environments

  2. Address Registry: For long-term maintainability, consider implementing a deployment address registry pattern (similar to what protocols like Aave use) where all contract addresses are stored in a central registry contract or JSON file

Related Files

  • local/punchswap/e2e_punchswap.sh - E2E test orchestration script
  • solidity/script/02_DeployUSDC_WBTC_Create2.s.sol - Token deployment with CREATE2
  • local/punchswap/punchswap.env - Configuration file with hard-coded addresses
  • solidity/script/03_UseMintedUSDCWBTC_AddLPAndSwap.s.sol - Strategy deployment using predicted addresses
What are you currently working on that this is blocking?

No response

主要言語
Cadence
スター
41
フォーク
0
PR マージ指標
30日以内にマージされた PR はありません

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

onflow/FlowYieldVaults のほかの issue

onflow/FlowYieldVaults の issue をすべて見る

似ている issue

Blockchain の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。