7

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 your plugins is called "Solidity Extended" by beaugunderson and disable it.


3

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 newAirline, address senderAddress) external requireIsOperational returns (address[] memory) { airlineVotes[newAirline].push(senderAddress); return airlineVotes[...


3

In general you can let a code run ignoring the compiler warnings. But it's always good not to do so. Most the time compiler warnings are warning you about something that may cause a bug in your code. Compared to compiler errors, the difference is your code is syntactically correct, hence can be compiled, but can lead to problems, specially when someone try ...


3

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 generally perform operations based on input params. An example illustrating the same is here: pragma solidity ^0.4.24; contract ViewVsPure { uint public age =...


3

Change function Owned() public { //.... } to constructor() public { /... } And Change all Transfer(msg.sender, to, tokens); to emit Transfer(msg.sender, to, tokens); and Approval(msg.sender, spender, tokens); to emit Approval(msg.sender, spender, tokens); As I mentioned in the comments, all the warnings you have here are deprecated ...


2

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 and warnings, such as no-trailing-whitespace: Line contains trailing whitespace. The best solution is to fix these warnings in your code, since the warnings ...


1

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 modifications.


1

Change the name of the interface from A to something else.


1

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. . http://solidity.readthedocs.io/en/develop/contracts.html#pure-functions


1

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 is provided in OpenZeppelin GitHub as open source, which means that it has been viewed, tested and verified thoroughly. No reason to implement it yourself.


1

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 code rather than just an image. Let me know if that helps!


1

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

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 mappings. For instance, with arrays: uint256[] private test; // array of uints256 of dynamic size Then you can add values doing: test.push(200); test.push(...


Only top voted, non community-wiki answers of a minimum length are eligible