#6 Payable Functions in Solidity — Smartcontract — Ethereum

rangesh sripathi
Feb 27, 2018 · 1 min read

Payable functions provide a mechanism to collect / receive funds in ethers to your contract . Payable functions are annotated with payable keyword.

In the above example payme function is annotated with payable keyword, which translates to that you can send ethers to payme function.

Where are the ethers stored in payable functions?

All the ethers sent to payable functions are owned by contract. In the above example Sample contract owns all of the ethers.

Payable fallback functions :

A function without any name and annotated with payable keyword is called payable fallback function. There could be only one such function in contract.

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store