diff options
author | Alex Beregszaszi <alex@rtfs.hu> | 2017-08-30 05:56:05 +0800 |
---|---|---|
committer | Alex Beregszaszi <alex@rtfs.hu> | 2017-09-02 02:09:36 +0800 |
commit | 8e1aae2e1a5c47fe11b5e17e670fcbb09ebda365 (patch) | |
tree | 86c8423bdaefdbcf3279c778b219e8fc84f85d88 | |
parent | f787ecae5a0186bb19a99ac8577123700b0c93a7 (diff) | |
download | dexon-solidity-8e1aae2e1a5c47fe11b5e17e670fcbb09ebda365.tar.gz dexon-solidity-8e1aae2e1a5c47fe11b5e17e670fcbb09ebda365.tar.zst dexon-solidity-8e1aae2e1a5c47fe11b5e17e670fcbb09ebda365.zip |
Document gas/value modifiers with overloading
-rw-r--r-- | docs/frequently-asked-questions.rst | 10 | ||||
-rw-r--r-- | docs/types.rst | 6 |
2 files changed, 6 insertions, 10 deletions
diff --git a/docs/frequently-asked-questions.rst b/docs/frequently-asked-questions.rst index 694b28d5..8fd0c041 100644 --- a/docs/frequently-asked-questions.rst +++ b/docs/frequently-asked-questions.rst @@ -441,16 +441,6 @@ The correct way to do this is the following:: } } -Is it possible to send a value while calling an overloaded function? -==================================================================== - -It's a known missing feature. https://www.pivotaltracker.com/story/show/92020468 -as part of https://www.pivotaltracker.com/n/projects/1189488 - -Best solution currently see is to introduce a special case for gas and value and -just re-check whether they are present at the point of overload resolution. - - ****************** Advanced Questions ****************** diff --git a/docs/types.rst b/docs/types.rst index 23a70837..d3ebfe14 100644 --- a/docs/types.rst +++ b/docs/types.rst @@ -139,6 +139,12 @@ Lastly, these modifiers can be combined. Their order does not matter:: nameReg.call.gas(1000000).value(1 ether)("register", "MyName"); +.. note:: + It is not yet possible to use the gas or value modifiers on overloaded functions. + + A workaround is to introduce a special case for gas and value and just re-check + whether they are present at the point of overload resolution. + In a similar way, the function ``delegatecall`` can be used: the difference is that only the code of the given address is used, all other aspects (storage, balance, ...) are taken from the current contract. The purpose of ``delegatecall`` is to use library code which is stored in another contract. The user has to ensure that the layout of storage in both contracts is suitable for delegatecall to be used. Prior to homestead, only a limited variant called ``callcode`` was available that did not provide access to the original ``msg.sender`` and ``msg.value`` values. All three functions ``call``, ``delegatecall`` and ``callcode`` are very low-level functions and should only be used as a *last resort* as they break the type-safety of Solidity. |