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

General: Conflicting ContractType error message isn't clear #178

Closed
sabotagebeats opened this issue Oct 7, 2021 · 4 comments · Fixed by #656
Closed

General: Conflicting ContractType error message isn't clear #178

sabotagebeats opened this issue Oct 7, 2021 · 4 comments · Fixed by #656
Assignees
Labels
category: bug Something isn't working size: 2 pieces Relatively easy, but requires some thought

Comments

@sabotagebeats
Copy link
Contributor

Environment information

(apeworx) sabotage@sabotage:~/ape/mixed-token$ ape --version
0.1.0a24
(apeworx) sabotage@sabotage:~/ape/mixed-token$ ape plugins list
Installed plugins:
  ape_infura (0.1.0a1)
  ape_trezor
(apeworx) sabotage@sabotage:~/ape/mixed-token$ python --version
Python 3.8.10
(apeworx) sabotage@sabotage:~/ape/mixed-token$ uname -a
Linux sabotage 5.4.0-88-generic #99-Ubuntu SMP Thu Sep 23 17:29:00 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
(apeworx) sabotage@sabotage:~/ape/mixed-token$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 20.04.3 LTS
Release:        20.04
Codename:       focal
(apeworx) sabotage@sabotage:~/ape/mixed-token$ rm -rf .build/
(apeworx) sabotage@sabotage:~/ape/mixed-token$ ls -la contracts/
total 20
drwxrwxr-x 2 sabotage sabotage 4096 Oct  7 21:14 .
drwxrwxr-x 3 sabotage sabotage 4096 Oct  7 21:43 ..
-rw-rw-r-- 1 sabotage sabotage  600 Oct  7 21:14 SafeMath.sol
-rw-rw-r-- 1 sabotage sabotage 4050 Oct  7 21:14 Token.sol
-rw-rw-r-- 1 sabotage sabotage 3861 Oct  7 21:14 Token.vy
(apeworx) sabotage@sabotage:~/ape/mixed-token$ ape compile
INFO: Compiling 'contracts/Token.sol'
INFO: Compiling 'contracts/SafeMath.sol'
INFO: Compiling 'contracts/Token.vy'
ERROR: ContractType collision across compiler plugins
(apeworx) sabotage@sabotage:~/ape/mixed-token$ ls -la .build/
total 8
drwxrwxr-x 2 sabotage sabotage 4096 Oct  7 21:44 .
drwxrwxr-x 4 sabotage sabotage 4096 Oct  7 21:44 ..

What went wrong?

ERROR: ContractType collision across compiler plugins
contracts are not compiled.

How can it be fixed?

refactor

@sabotagebeats sabotagebeats added the category: bug Something isn't working label Oct 7, 2021
@sabotagebeats
Copy link
Contributor Author

this is also an issue in previous version 0.1.0a23 with ape-vyper 0.1.0a6 (0a7 is not compatible with a23)

@fubuloubu
Copy link
Member

This has an easy explanation: you can't use the same name for a smart contract inside your project. Token.vy means the name ends up being the same there, and willing to bet that Token.sol just uses contract Token { ... } internally, hence same name.

@fubuloubu
Copy link
Member

Update error message so that the fix is clearer for end-users

@fubuloubu fubuloubu reopened this Oct 8, 2021
@fubuloubu fubuloubu changed the title bug: ERROR: ContractType collision across compiler plugins when compiling vyper and solidity in same folder Conflicting ContractType error message isn't clear Oct 8, 2021
@antazoey antazoey changed the title Conflicting ContractType error message isn't clear General: Conflicting ContractType error message isn't clear Jan 27, 2022
@antazoey
Copy link
Member

antazoey commented Mar 29, 2022

  • Include some relevant data in the error message

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category: bug Something isn't working size: 2 pieces Relatively easy, but requires some thought
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants