-
Notifications
You must be signed in to change notification settings - Fork 6.1k
[DOCS] Merge payable FAQ item #5796
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Codecov Report
@@ Coverage Diff @@
## develop #5796 +/- ##
========================================
Coverage 88.35% 88.35%
========================================
Files 348 348
Lines 33378 33378
Branches 3998 3998
========================================
Hits 29492 29492
Misses 2532 2532
Partials 1354 1354
|
What happens if you send ether along with a function call to a contract? | ||
======================================================================== | ||
|
||
It gets added to the total balance of the contract, just like when you send ether when creating a contract. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd add this to https://solidity.readthedocs.io/en/v0.5.2/structure-of-a-contract.html#functions. Or is this explained somewhere else?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I feel like it's mentioned enough in docs/contracts/functions.rst
(See the commits), but let me know what you think. When that's done I'll rebase @ekpyron
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the current functions sections:
Function Calls can happen internally or externally and have different levels of visibility towards other contracts. Functions accept parameters and return variables to pass parameters and values between them.
I'd say it would be reasonable to include something along the lines "Functions can also have special attributes (modifiers?), like payable
[link here]"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@axic In the section below this paragraph is a section about function modifiers. Thing is, in your suggestion you mention linking to a list of function modifiers, and I agree, there isn't really a list (in one place) of what's available. So I think creating one is a good idea, but perhaps out of scope of this PR?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ChrisChinchilla That sounds like a good idea. Let's create an issue for that and merge this one :)
Needs to be rebased. |
What happens if you send ether along with a function call to a contract? | ||
======================================================================== | ||
|
||
It gets added to the total balance of the contract, just like when you send ether when creating a contract. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ChrisChinchilla That sounds like a good idea. Let's create an issue for that and merge this one :)
1898a3a
to
a1df27a
Compare
@bit-shift And there was a merge conflict, will need that approval again, sorry! |
Merge
payable
FAQ item into docs, part of #1219Checklist