Questions tagged [warnings]

Questions are related to the warnings appearing in the code.

Filter by
Sorted by
Tagged with
0
votes
0answers
23 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 ...
1
vote
1answer
16 views

VS Code and Solidity files have a lot of warnings

Every time I use VS Code to develop Solidity, files I have a lot of this weird warnings saying: no-trailing-whitespace: Line contains trailing whitespace I googled a bit and I understand why they ...
-1
votes
3answers
357 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 == ...
0
votes
1answer
63 views

Static Analysis raised 9 warning(s) that requires your attention. Click here to show the warning(s)

I receive these warnings in REMIX so the question is: Can I compile my contract and then verify it regardless of these warnings? pragma solidity ^0.4.25; library SafeMath { function mul(uint256 a,...
0
votes
2answers
288 views

Remix warning - Is constant but potentially should not be.

I am getting the warning on the code shown below. Could you please assist me know to resolve this warning ? warning message - "Is constant but potentially should not be"
0
votes
1answer
110 views

Why does this trivial function has “Gas requirement high: infinite”?

I wrote this trivial contract in Remix: pragma solidity ^0.4.24; contract HelloWorld { function greet() public pure returns (bytes32) { return bytes32('Hello World!'); } } I got ...
0
votes
1answer
45 views

How can I read the entire Solidity warning in the Remix browser?

When I get a Solidity warning in the Remix browser, I can usually just hover over the warning symbol to the left of the editor and read the error message. But, this time the end of the error message ...
0
votes
2answers
34 views

Initializing full array warning

I initialized a full uint256 array like this: uint256[2**256-1] private test; And I get this warning for the compiler: Warning: Variable covers a large part of storage and thus makes collisions ...
0
votes
1answer
142 views

Yellow flags, simple replacement?

Can anyone give me a straight answer, (not trained stranded in no man lands) do I just change the words from (functions to Constructor) yellow warnings below. browser/ballot.sol:77:5: Warning: ...
4
votes
2answers
3k views

Remix Warning - No visibility specified, Violate Checks-Effects-Interaction pattern, Function state mutability can be restricted to pure - Can ignore?

Two months ago, I wrote a smart contract with Remix.ethereum.org. Line 1 of my code has: pragma solidity ^0.4.11; It compiled fine with no errors and nor warnings. I tested every function in ...