DeclarationError: Identifier not found or not unique although the contract exists

DeclarationError: Identifier not found or not unique although the contract exists

Manage alerts

Loading saved threads...

zendevil.eth · External communityPost link
External question — Ethereum Stack Exchange Author: zendevil.eth Original post: https://ethereum.stackexchange.com/questions/109513 License: CC BY-SA 4.0 — https://creativecommons.org/licenses/by-sa/4.0/ Adaptation: HTML converted to plain text; contact email addresses removed. I have a contract that imports another contract that I have locally: pragma solidity ^0.7.4; import "./ERC1155Tradeable.sol"; contract YieldToken is ERC1155Tradeable { ... } However, I get the following error: > Compilation warnings encountered: @0xsequence/erc-1155/contracts/utils/Address.sol: Warning: SPDX license identifier not provided in source file. Before publishing, consider adding a comment containing "SPDX-License-Identifier: <SPDX-License>" to each source file. Use "SPDX-License-Identifier: UNLICENSED" for non-open-source code. Please see https://spdx.org for more information. ,@0xsequence/erc-1155/contracts/utils/ERC165.sol: Warning: SPDX license identifier not provided in source file. Before publishing, consider adding a comment containing "SPDX-License-Identifier: <SPDX-License>" to each source file. Use "SPDX-License-Identifier: UNLICENSED" for non-open-source code. Please see https://spdx.org for more information. ,@0xsequence/erc-1155/contracts/utils/Ownable.sol: Warning: SPDX license identifier not provided in source file. Before publishing, consider adding a comment containing "SPDX-License-Identifier: <SPDX-License>" to each source file. Use "SPDX-License-Identifier: UNLICENSED" for non-open-source code. Please see https://spdx.org for more information. ,@0xsequence/erc-1155/contracts/utils/SafeMath.sol: Warning: SPDX license identifier not provided in source file. Before publishing, consider adding a comment containing "SPDX-License-Identifier: <SPDX-License>" to each source file. Use "SPDX-License-Identifier: UNLICENSED" for non-open-source code. Please see https://spdx.org for more information. ,project:/contracts/ERC1155Tradeable.sol: Warning: SPDX license identifier not provided in source file. Before publishing, consider adding a comment containing "SPDX-License-Identifier: <SPDX-License>" to each source file. Use "SPDX-License-Identifier: UNLICENSED" for non-open-source code. Please see https://spdx.org for more information. ,project:/contracts/NFT.sol: Warning: SPDX license identifier not provided in source file. Before publishing, consider adding a comment containing "SPDX-License-Identifier: <SPDX-License>" to each source file. Use "SPDX-License-Identifier: UNLICENSED" for non-open-source code. Please see https://spdx.org for more information. ,project:/contracts/Strings.sol: Warning: SPDX license identifier not provided in source file. Before publishing, consider adding a comment containing "SPDX-License-Identifier: <SPDX-License>" to each source file. Use "SPDX-License-Identifier: UNLICENSED" for non-open-source code. Please see https://spdx.org for more information. ,project:/contracts/YieldToken.sol: Warning: SPDX license identifier not provided in source file. Before publishing, consider adding a comment containing "SPDX-License-Identifier: <SPDX-License>" to each source file. Use "SPDX-License-Identifier: UNLICENSED" for non-open-source code. Please see https://spdx.org for more information. ,project:/contracts/NFT.sol: Warning: Source file does not specify required compiler version! Consider adding "pragma solidity ^0.7.4;" project:/contracts/YieldToken.sol:5:24: DeclarationError: Identifier not found or not unique. contract YieldToken is ERC1155Tradeable { ^--------------^ Compilation failed. See above. How to fix this?
Quote
Report
Ahmad Gorji · External communityPost link
External answer — Ethereum Stack Exchange Author: Ahmad Gorji Original post: https://ethereum.stackexchange.com/a/109516 License: CC BY-SA 4.0 — https://creativecommons.org/licenses/by-sa/4.0/ Adaptation: HTML converted to plain text; contact email addresses removed. check ./ERC1155Tradeable.sol contract name. If it is different from file name, you must inherit from contract name.
Quote
Report

Post Reply

Quoted from Forex.com.bd-Editorial External answer — Ethereum Stack Exchange Author: Ahmad Gorji Source score (net votes, not local likes): 0 Original post: https://ethereum.stackexchange.com/a/109516 License: CC BY-SA 4.0 — https://creativecommons.org/licenses/by-sa/4.0/ Adaptation: HTML converted to plain text; contact email addresses removed. check ./ERC1155Tradeable.sol contract name. If it is different from file name, you must inherit from contract name.

Cancel quote

Checking account access…