7
votes
Accepted
VS code Expected identifier, got 'LParen'solc
I have had a similar error, then I realized the culprit in this case was in fact a malfunctioning VS Code plugin not Solidity nor truffle. Please check your plugins list in VS Code and see if one of ...
3
votes
Warning: Unnamed return variable can remain unassigned. Add an explicit return with value to all non-reverting code paths or name the variable
The function is declared as returning a address[] memory, but the code doesn't return anything.
If you want to return airlineVotes[newAirline] use the return.
function addAirlineVotes(address ...
3
votes
Accepted
Remix Warning - No visibility specified, Violate Checks-Effects-Interaction pattern, Function state mutability can be restricted to pure - Can ignore?
In general
You can let the code run, ignoring the compiler warnings, but it's always good not to do so. Most of the time, compiler warnings are warning you about something that may cause a bug in your ...
3
votes
Remix Warning: Function state mutability can be restricted to pure
View can be used to with a function that does not modify the state but reads state variables.
Pure should be used with functions that neither modify state nor read ( access) state variables. They ...
3
votes
Accepted
Yellow flags, simple replacement?
Change
function Owned() public {
//....
}
to
constructor() public {
/...
}
And
Change all
Transfer(msg.sender, to, tokens); to emit Transfer(msg.sender, to, tokens);
and
Approval(...
2
votes
Accepted
VS Code and Solidity files have a lot of warnings
The reason they exist is because you are using the VS Code Solidity extension. One feature of this extension is that it enables Solium (now Ethlint). This is a linter that checks your code for errors ...
1
vote
compilerMetadata is modifying/artifacts/NAME_OF_CONTRACT.json
It's better to UNCHECK the Generate contract metadata. from the setting as @Akrramo mentioned otherwise if you UNCHECK the Auto compile then you have to compile the code every time you do some ...
1
vote
1
vote
Remix Warning - No visibility specified, Violate Checks-Effects-Interaction pattern, Function state mutability can be restricted to pure - Can ignore?
browser/TestContract 8.sol:100:3 Warning: Function state mutability can be restricted to pure
Answer:
Functions can be declared pure in which case they promise not to read from or modify the state.
....
1
vote
Remix Warning: Function state mutability can be restricted to pure
They're not the same.
view functions have read-only access permission on state variables.
pure functions do not.
Those functions that you mention can all be declared pure.
Side note: this library ...
1
vote
Static Analysis raised 9 warning(s) that requires your attention. Click here to show the warning(s)
Yes. You should be able to run the smart contract since these are just warnings. Although they should be addressed at some point in the future. In addition, it would be helpful to post a link to the ...
1
vote
Why does this trivial function has "Gas requirement high: infinite"?
Leave default parameters in remix for Gaslimit and wei - dont touch it. Set it in MetaMask. It`s helped me, since I had same issue.
1
vote
Initializing full array warning
The size of the array you are trying to initialize is extremely big (1.1579209e+77 registers of 256 bits each one!!!!). If you do not know the maximum size you will require, just use dynamic arrays or ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
warnings × 17solidity × 11
remix × 10
compiler × 3
contract-development × 2
tokens × 2
gas × 2
visual-studio-code × 2
go-ethereum × 1
truffle × 1
private-blockchain × 1
arrays × 1
solc × 1
compilation × 1
selfdestruct × 1
ide × 1
constant × 1