Skip to main content
Share Your Experience: Take the 2024 Developer Survey

Questions tagged [declaration]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1 vote
1 answer

How to fix naming scheme and undeclared identifier errors?

I have a question about something that has been bugging me for quite some time now. I am a bit confused on naming schemes in solidity and how I should go about it. For example, the biggest thing for ...
EGstacking's user avatar
0 votes
1 answer

Data location must be "calldata" for parameter in external function, but none was given. --> Undeclared identifier

In Remix, I'm getting the following error. contracts/TestBench.sol:138:30: TypeError: Data location must be "calldata" for parameter in external function, but none was given. function ...
Mowzer's user avatar
  • 211
0 votes
1 answer

Warning: This declaration shadows an existing declaration

Can you please help me out with this code, where I get the six warnings shown bellow? As a result, the withdrawal doesn't go through with the specified amount. But I don't know how to get around it. ...
f22daniel's user avatar
  • 363
0 votes
1 answer

Declaration Error when defining function to return token name

I am trying to create an ERC20 contract. Below is my code for it. pragma solidity ^0.8.0; contract ERC20Interface { mapping(address => uint256) private _balances; mapping(address => mapping(...
David's user avatar
  • 1
0 votes
0 answers

contracts/FlashLoan DeclarationError: Identifier already declared

Error message contracts/FlashLoanReceiverBase.sol:9:1: DeclarationError: Identifier already declared. import "./Withdrawable.sol"; ^--------------------------^
mahi's user avatar
  • 1
0 votes
1 answer

Variable declaration

I am new to solidity.Below is the snippet of solidity source code which I came across :- pragma solidity ^0.5.1; library SafeMath { function sub(uint256 a, uint256 b) internal pure returns (...
Brijesh's user avatar
  • 43
2 votes
1 answer

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 "./...
Luex's user avatar
  • 61
0 votes
1 answer

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; ...
Prime Relaxation's user avatar
0 votes
1 answer

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: ...
Crypto Jimmy's user avatar
0 votes
2 answers

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; ...
ashish codewexy's user avatar
1 vote
2 answers

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 ...
Ahmed Ihsan Tawfeeq's user avatar