Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Definition of the function returns a value but is not defined as a view function. #56

Open
WillMandrill opened this issue Jul 19, 2020 · 1 comment

Comments

@WillMandrill
Copy link

Hello

I have this very simple Smart Contract:

// SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.4.16 <0.7.0;

contract SimpleStorage {
    uint storedData;

    function set(uint x) public {
        storedData = x;
    }

    function get() public view returns (uint) {
        return storedData;
    }
}

When I compite with java maven

org.web3j
web3j-maven-plugin
4.5.11

I get this warnings:
[WARNING] Definition of the function get returns a value but is not defined as a view function. Please ensure it contains the view modifier if you want to read the return value
[INFO] Built Class for contract 'SimpleStorage'

Why this happens, it is clearly defined as public view

Can anybody help?

Thank you

Will

@xaviarias
Copy link
Contributor

xaviarias commented Oct 6, 2020

Which version of Solidity compiler are you using? These warnings are printed by solc not the plugin itself.

We are soon going to release a new plugin version that will probably fix this using the right solc version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants