[Ethereum] what is the difference between payable and view in a smart contract in solidity

payableremixsolidityview

I don't quite understand the concept of payable in a function in the smart contract and the difference between payable ,view and pure.

Best Answer

Payable means that the function can receive Ether via that function call. Comments in this contract explain this modifier.

View means that the function only reads from member variables contained within the contract. Explained here.

Pure states that no member variables within the contract are read from — all required data is in scope within the function itself. Explained here.