Skip to content

Potentially should be constant/view/pure but is not error in the code #1802

Answered by cromewar
ShivSankar asked this question in Q&A
Discussion options

You must be logged in to vote

I checked this and there is nothing wrong with your code, this is just a recommendation provided by the solidity extension on REMIX but you can safely ignore this warning, you cannot use those types because:

  • Pure is for mathematical operations.
  • constant for functions which will not alter the state of a contract.
  • view will not make state changes and this function does.

I hope this info might help, cheers.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by cromewar
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants