# Solidity:Pure And View Functions

By [Yusuf.dev](https://paragraph.com/@yusufx) · 2023-03-11

---

![](https://storage.googleapis.com/papyrus_images/5430f8fa4825cfb2882af27545830d8bfb65b98a653cdfd7fc084a717fe4bcf7.png)

`Functions can be declared as view if it is not modifying blockchains state. In our context, blockchain state is the value of the number variable.`

`setNumber method changes the value of the variable so it cannot be declared as view. But GetNumber only reads blockchain’s state so it should be declared as view.`

Pure methods are the ones that don’t read or modify the blockchain’s state.`addTwoNumbers` answers the description of pure methods.

---

*Originally published on [Yusuf.dev](https://paragraph.com/@yusufx/solidity-pure-and-view-functions)*
