diff options
author | Leonardo Alt <leo@ethereum.org> | 2018-07-05 20:32:32 +0800 |
---|---|---|
committer | Leonardo Alt <leo@ethereum.org> | 2018-07-12 18:53:49 +0800 |
commit | 3ebfcae8292da1d9f41ff20da1866c424404ee58 (patch) | |
tree | 0b6845c1598d81ed72ebe2b2d44272f6f51f284c /docs/control-structures.rst | |
parent | c438b73f689b904152f4b8b636579317fb55e60a (diff) | |
download | dexon-solidity-3ebfcae8292da1d9f41ff20da1866c424404ee58.tar dexon-solidity-3ebfcae8292da1d9f41ff20da1866c424404ee58.tar.gz dexon-solidity-3ebfcae8292da1d9f41ff20da1866c424404ee58.tar.bz2 dexon-solidity-3ebfcae8292da1d9f41ff20da1866c424404ee58.tar.lz dexon-solidity-3ebfcae8292da1d9f41ff20da1866c424404ee58.tar.xz dexon-solidity-3ebfcae8292da1d9f41ff20da1866c424404ee58.tar.zst dexon-solidity-3ebfcae8292da1d9f41ff20da1866c424404ee58.zip |
Update external tests and docs
Diffstat (limited to 'docs/control-structures.rst')
-rw-r--r-- | docs/control-structures.rst | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/docs/control-structures.rst b/docs/control-structures.rst index 50c401e2..52a07861 100644 --- a/docs/control-structures.rst +++ b/docs/control-structures.rst @@ -418,18 +418,18 @@ a message string for ``require``, but not for ``assert``. :: - pragma solidity ^0.4.22; + pragma solidity >0.4.24; contract Sharer { function sendHalf(address addr) public payable returns (uint balance) { require(msg.value % 2 == 0, "Even value required."); - uint balanceBeforeTransfer = this.balance; + uint balanceBeforeTransfer = address(this).balance; addr.transfer(msg.value / 2); // Since transfer throws an exception on failure and // cannot call back here, there should be no way for us to // still have half of the money. - assert(this.balance == balanceBeforeTransfer - msg.value / 2); - return this.balance; + assert(address(this).balance == balanceBeforeTransfer - msg.value / 2); + return address(this).balance; } } |