Questions tagged [declaration]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
0 answers
22 views

DeclarationError: "Identifier already declared" when compiling SmartContract with solc

I have a Smart Contract "MyCoin". It has another SmartContract "Dex" as dependency. MyCoin: import "./openzeppelin/contracts/token/ERC721/IERC721.sol"; // import "./...
user avatar
  • 27
0 votes
0 answers
24 views

CompileError: DeclarationError: Identifier already declared

Wondering if anyone has a fix/idea for this. The error seems to be with the import below. I have tested it with remix and the smartcontracts all work fine with me importing directly from github. I ...
user avatar
0 votes
0 answers
14 views

Creating a dynamic Array- Solidity- Error

Declaration Error: Identifier not found or not unique contract MexicoCity { uint256 public favoriteNumber; function store(uint256 _10time) public { favoriteNumber = _10time; ...
user avatar
0 votes
1 answer
15 views

A function made in my contract while trying to compile the contract showed this; TypeError: Referenced declaration is neither modifier nor base class

//SPDX-Licence-Identifier: MIT pragma solidity ^0.8.11; contract PurchaseAgreement { // VARIABLES uint public value; address payable public seller; address payable public buyer; ...
user avatar
0 votes
1 answer
21 views

Why do I have a declaration error showing Identifier not found or not unique

I am writing the smart contract for NFT. it is my first one. it is showing the DeclarationError as below and I do not know how to solve it. Could you please kindly help me? Thank you from solidity: ...
user avatar
0 votes
2 answers
53 views

Warning: Unused function parameter. Remove or comment out the variable name to silence this warning. This declaration shadows an existing declaration

function Createvault(string memory name, address[] memory users, uint initialamount)public returns(uint vaultId){ vault storage vault = vaults[totalvaults]; vault.creator = msg.sender; ...
user avatar
0 votes
2 answers
79 views

Value assignment for storage variable (in declaration VS in constructor)

What difference does it make if I assign the value of a storage variable in the same line where it is declared vs if I assign its value in the constructor? Which would be the preferred approach? And ...
user avatar