hi, I can't figure out how should I use openzeppelin contract with solc for it not to throw the error... (the screenshot is more obvious in the last message)
could you please tell how to make in the right way? everybody just advicing me to use hardhat or smth else... and telling that solc is really bad for anything.... but is it?)) thank you
hi, I can't figure out how should I use openzeppelin contract with solc for it not to throw the error... (the screenshot is more obvious in the last message)
{ errors: [ { component: 'general', errorCode: '2333', formattedMessage: 'DeclarationError: Identifier already declared.\n' + ' --> CryptoDevs.sol:6:1:\n' + ' |\n' + formattedMessage: 'DeclarationError: Identifier already declared.\n' + ' --> CryptoDevs.sol:7:1:\n' + ' |\n' + '7 | import "./IWhitelist.sol";\n' + ' | ^^^^^^^^^^^^^^^^^^^^^^^^^^\n' + 'Note: The previous declaration is here:\n' + ' --> @openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol:16:1:\n' + ' |\n' + '16 | abstract contract Context {\n' + ' | ^ (Relevant source part starts here and spans across multiple lines).\n' + '\n', message: 'Identifier already declared.', secondarySourceLocations: [Array], severity: 'error', sourceLocation: [Object], type: 'DeclarationError' } ], sources: { '@openzeppelin/contracts/access/Ownable.sol': { id: 0 }, '@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol': { id: 1 }, 'CryptoDevs.sol': { id: 2 }, 'IWhitelist.sol': { id: 3 } } }
the code
` // SPDX-License-Identifier: MIT pragma solidity 0.8.19;
// import "@openzeppelin/contracts/utils/Context.sol"; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "./IWhitelist.sol";
contract CryptoDevs is ERC721, Ownable { string _baseTokenURI;
} `
index.ts `import fs from 'fs'; //@ts-ignore import solc from 'solc'; import { JsonRpcProvider, ContractFactory, Wallet } from 'ethers'; import 'dotenv/config'; import { METADATA_URL, WHITELIST_CONTRACT_ADDRESS } from './config';
(async () => { const source = fs.readFileSync('./contracts/CryptoDevs.sol', 'utf-8');
})(); `
could you please tell how to make in the right way? everybody just advicing me to use hardhat or smth else... and telling that solc is really bad for anything.... but is it?)) thank you