Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

fix(cli): foundry plugin support for multiple addresses with same ABI #4410

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

starc007
Copy link
Contributor

Fixes #4396

Description

the foundry plugin now properly handles multiple addresses sharing the same ABI (e.g., different ERC20 tokens). When a deployment specifies multiple addresses for a contract, it generates unique configurations with appropriate names while maintaining the shared ABI.

e.g

// Before: Only one contract config would be generated
foundry({
  deployments: {
    ERC20: {
      DAI: '0xDA10009cBd5D07dd0CeCc66161FC93D7c9000da1',
      WETH: '0x4200000000000000000000000000000000000006'
    }
  }
})

// After: Generates unique configs for each token
// Generates:
// - ERC20_DAI with DAI address
// - ERC20_WETH with WETH address
// Both sharing the same ERC20 ABI

Changes

  • Added support for named address mappings in FoundryConfig type
  • Implemented contract name generation with suffixes for multiple addresses
  • Added ABI sorting for consistent output
  • Added test coverage for multiple address scenarios

Copy link

changeset-bot bot commented Nov 13, 2024

🦋 Changeset detected

Latest commit: 9a51d9b

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@wagmi/cli Major

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link

vercel bot commented Nov 13, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
wagmi ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 21, 2024 8:08am

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bug: foundry plugin multiple addresses referencing the same ABI
2 participants