Skip to content
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.

CompileError: project:/contracts/kyc.sol:4:1: DeclarationError: Identifier already declared. #5254

Closed
1 task
neetu-sharma opened this issue Jul 1, 2022 · 3 comments

Comments

@neetu-sharma
Copy link

ompiling your contracts...

Compiling ./contracts/Migrations.sol
Compiling ./contracts/admininterface.sol
Compiling ./contracts/kyc.sol

CompileError: project:/contracts/kyc.sol:4:1: DeclarationError: Identifier already declared.
contract KYC is admininterface {
^ (Relevant source part starts here and spans across multiple lines).
project:/contracts/kyc.sol:2:1: The previous declaration is here:
import './admininterface.sol';
^----------------------------^

Compilation failed. See above.
at /usr/local/lib/node_modules/truffle/build/webpack:/packages/compile-solidity/dist/run.js:64:1
at Generator.next ()
at fulfilled (/usr/local/lib/node_modules/truffle/build/webpack:/packages/compile-solidity/dist/run.js:4:43)
Truffle v5.5.19 (core: 5.5.19)
Node v18.4.0

Issue

What the issue is, in broad strokes.

Steps to Reproduce

Please provide the shortest amount of steps to reproduce your issue.

Expected Behavior

What you expected to happen.

Actual Results

What actually happened. Please give examples and support it with screenshots, copied output or error messages.

Environment

  • Operating System:
  • Ethereum client:
  • Truffle version (truffle version):
  • node version (node --version):
  • npm version (npm --version):
@eggplantzzz
Copy link
Contributor

Hey @neetu-sharma, looks like you may have a Solidity error as that error is coming from the Solidity compiler. Can you check your code for syntax errors? Also, if you want to link to your project on GitHub I'll happily take a look to see if I can spot an error.

@haltman-at
Copy link
Contributor

It looks like most likely they're trying to redeclare an identifier that was already declared in an import.

@cds-amal
Copy link
Member

cds-amal commented Aug 4, 2022

Closing for issue maintenance. Thanks!

@cds-amal cds-amal closed this as completed Aug 4, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants