Questions tagged [warnings]
Questions are related to the warnings appearing in the code.
22 questions
2 votes
2 answers
1k views
Contract code size is 24798 bytes and exceeds 24576 bytes
I have a contract that all of the functions either change the state or return data from storage. I have tried the techniques to reduce the size and it helped a bit. However, I need to add a couple ...
0 votes
1 answer
163 views
"Warning: Unreachable code" in solidity when overriding a function to make it fail and that is used elsewhere
I have the following code sample pragma solidity ^0.8.13; error MyError(); abstract contract A { function f1() public pure virtual returns(bool); function f2() public pure virtual returns(...
0 votes
1 answer
200 views
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. ...
0 votes
0 answers
111 views
how can i fix these loop warnings and gas fee warnings. the code is compiled fine just want to update these warnings before launch
Here's the contract code to the token "alex". Below are the warnings from remix. Thanks for any assistance // SPDX-License-Identifier: MIT pragma solidity 0.8.4; contract alex { ...
3 votes
3 answers
5k views
compilerMetadata is modifying/artifacts/NAME_OF_CONTRACT.json
I have been getting a compiler warning in the online remix IDE that is not quite clear to me (the contract compiles and deploys without any errors): compilerMetadata is modifying/artifacts/...
0 votes
1 answer
467 views
Duplicate contract name
I have two contracts. Contract A is given by: //A.sol pragma solidity ^0.5.8; contract A { address owner; constructor() public{ owner = msg.sender; } function transferTo(address to,...
4 votes
1 answer
864 views
VS code Expected identifier, got 'LParen'solc
I keep getting this error/warning on my vscode when I emit events and build constructors. or After a bit of googling I understand it is something about my compiler, since solc <0.4.18 does not ...
0 votes
3 answers
3k views
Remix Warning: Function state mutability can be restricted to pure
Which is the best, view or pure instead of constant? library SafeMath { function mul(uint256 a, uint256 b) internal constant returns (uint256) { uint256 c = a * b; assert(a == 0 || c / a == ...