#6 Payable Functions in Solidity — Smartcontract — Ethereum

Rangesh Sripathi
1 min readFeb 27, 2018

--

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.

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

--

--

Responses (2)