I have used solidity smart contracts since 3 months ago, but I never used the decorator "payable".

Is it sometimes necessary to use a payable function?


Payable is necessary if you want the method to be able to receive funds or a "value".

For example, if I create a crowdsale-contract the payable function will be handling the receiving of the funds.

| improve this answer | |
  • and what about if the method use a lot of gas ? isn't necessary to add payable decorator ? – maroodb May 18 '18 at 8:35
  • Nope, gas has nothing to do with the payable decoration. – jasper May 18 '18 at 8:37

Not the answer you're looking for? Browse other questions tagged or ask your own question.