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

Function state mutability can be restricted to pure #608

Closed
wants to merge 1 commit into from
Closed

Function state mutability can be restricted to pure #608

wants to merge 1 commit into from

Conversation

e11io
Copy link

@e11io e11io commented Dec 13, 2017

Addresses the issue on truffle compile:

zeppelin-solidity/contracts/ownership/HasNoTokens.sol:20:3: Warning: Function state mutability can be restricted to pure
  function tokenFallback(address from_, uint256 value_, bytes data_) external {

@frangio
Copy link
Contributor

frangio commented Dec 22, 2017

Thanks for the suggestion @e11io. 😄

The warning is annoying, but the function is left non-pure because it's meant to define a default behavior that can be overriden in a possibly non-constant way. Constant functions cannot be overriden by non-constant ones.

This is not ideal, but it means we cannot make the function pure.

@frangio frangio closed this Dec 22, 2017
@BlinkyStitt
Copy link

That's good to know, @frangio. Is there some way to silence these warnings? I know you can silence things with solhint, but I'm not sure about solc.

We should be careful not to fix them with #1346

@frangio
Copy link
Contributor

frangio commented Jan 7, 2019

I don't think there is a way to silence these warnings. 😞

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

Successfully merging this pull request may close these issues.

3 participants