I don't quite understand the concept of payable in a function in the smart contract and the difference between payable ,view and pure.
[Ethereum] what is the difference between payable and view in a smart contract in solidity
payableremixsolidityview
Related Topic
- Solidity Timestamp – Difference Between `now` and `block.timestamp`
- [Ethereum] Why is there more than one payable function in a solidity contract
- Transactions – Difference Between fallback() and receive(), and Payable vs Transfer in Solidity?
- Solidity OpenZeppelin – Difference Between __init and __init_unchained in Proxy Contracts
- Solidity Web3JS – Use of Pure and View in Solidity Explained
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.