Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Foundry Plugin Error - Contract Name "IERC721TokenReceiver" Must Be Unique #3951

Closed
1 task done
alexx855 opened this issue May 20, 2024 · 1 comment · Fixed by #4012
Closed
1 task done

Foundry Plugin Error - Contract Name "IERC721TokenReceiver" Must Be Unique #3951

alexx855 opened this issue May 20, 2024 · 1 comment · Fixed by #4012

Comments

@alexx855
Copy link

alexx855 commented May 20, 2024

Bug description

When setting up a new create wagmi project and configuring Foundry according to the documentation, an error occurs during the wagmi generate command. The error message indicates that the contract name "IERC721TokenReceiver" must be unique.

Steps to Reproduce

  1. Initialize a new create wagmi project.
  2. Configure Foundry wagmi plugin.
  3. Create a new Foundry project using forge init.
  4. Attempt to generate wagmi artifacts with wagmi generate.
> wagmi generate
✔ Validating plugins
⠹ Resolving contracts
Contract name "IERC721TokenReceiver" must be unique.
 ELIFECYCLE  Command failed with exit code 1.

My Configuration File (wagmi.config.ts)

export default defineConfig({
  out: 'src/generated.ts',
  contracts: [],
  plugins: [
    foundry({
      project: '../hello_foundry',
    }),
  ],
})

Cause

The issue is caused by a conflict with forge-std version 1.8.0 or higher, which is installed by default with Foundry.

Solution

To resolve this issue, i downgraded forge-std to version 1.7.6. Following these steps:

  1. Remove the current version of forge-std:
forge remove foundry-rs/forge-std
git commit -m "Removed foundry-rs/forge-std"
  1. Install version 1.7.6 of forge-std:
forge install foundry-rs/forge-std@v1.7.6
forge clean

Link to Minimal Reproducible Example

No response

Steps To Reproduce

No response

Wagmi Version

latest

Viem Version

latest

TypeScript Version

5.2.2

Check existing issues

Anything else?

Let me know if i can help somehow!

@script-money
Copy link

Meet the some issue

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

Successfully merging a pull request may close this issue.

2 participants