diff options
author | gl367 <gl367@cornell.edu> | 2016-08-16 22:26:57 +0800 |
---|---|---|
committer | chriseth <chris@ethereum.org> | 2016-08-16 22:26:57 +0800 |
commit | c547f9c24b5bd57840ddd5543ab6e5288ddc5563 (patch) | |
tree | 8feff36180c8a26b05a279212f86ec9ff63f2cbe /docs | |
parent | dbc95570cb4ac53688ebf07c2e5fdbce1ef8089d (diff) | |
download | dexon-solidity-c547f9c24b5bd57840ddd5543ab6e5288ddc5563.tar.gz dexon-solidity-c547f9c24b5bd57840ddd5543ab6e5288ddc5563.tar.zst dexon-solidity-c547f9c24b5bd57840ddd5543ab6e5288ddc5563.zip |
fix typo in costs modifier (#850)
Diffstat (limited to 'docs')
-rw-r--r-- | docs/common-patterns.rst | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/docs/common-patterns.rst b/docs/common-patterns.rst index 422e2758..322be3ef 100644 --- a/docs/common-patterns.rst +++ b/docs/common-patterns.rst @@ -82,13 +82,13 @@ restrictions highly readable. // refunded, but only after the function body. // This is dangerous, because if the function // uses `return` explicitly, this will not be - // done! + // done! This behavior will be fixed in Version 0.4.0. modifier costs(uint _amount) { if (msg.value < _amount) throw; _ if (msg.value > _amount) - msg.sender.send(_amount - msg.value); + msg.sender.send(msg.value - _amount); } function forceOwnerChange(address _newOwner) @@ -163,7 +163,9 @@ function finishes. the code in the transitionNext modifier can be skipped if the function itself uses return. If you want to do that, make sure - to call nextStage manually from those functions. + to call nextStage manually from those functions. + With version 0.4.0 (unreleased), modifier code + will run even if the function explicitly returns. :: |