diff options
author | Daniel Kirchner <daniel@ekpyron.org> | 2018-08-16 07:09:40 +0800 |
---|---|---|
committer | Daniel Kirchner <daniel@ekpyron.org> | 2018-09-04 19:31:10 +0800 |
commit | cf69433f2312afc2b76b00dd202f114d9f546309 (patch) | |
tree | 46d09e216b10dbdbf270e55d4f428ea515c0120a /docs/contracts.rst | |
parent | 0011f8aef9ef949fc971fceed2e319adb6a58ec1 (diff) | |
download | dexon-solidity-cf69433f2312afc2b76b00dd202f114d9f546309.tar.gz dexon-solidity-cf69433f2312afc2b76b00dd202f114d9f546309.tar.zst dexon-solidity-cf69433f2312afc2b76b00dd202f114d9f546309.zip |
Update documentation.
Diffstat (limited to 'docs/contracts.rst')
-rw-r--r-- | docs/contracts.rst | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/docs/contracts.rst b/docs/contracts.rst index 669a374f..8fd1c89e 100644 --- a/docs/contracts.rst +++ b/docs/contracts.rst @@ -406,7 +406,8 @@ inheritable properties of contracts and may be overridden by derived contracts. /// The `return 7` statement assigns 7 to the return value but still /// executes the statement `locked = false` in the modifier. function f() public noReentrancy returns (uint) { - require(msg.sender.call("")); + (bool success,) = msg.sender.call(""); + require(success); return 7; } } @@ -645,7 +646,8 @@ Like any function, the fallback function can execute complex operations as long contract Caller { function callTest(Test test) public returns (bool) { - require(address(test).call(abi.encodeWithSignature("nonExistingFunction()"))); + (bool success,) = address(test).call(abi.encodeWithSignature("nonExistingFunction()")); + require(success); // results in test.x becoming == 1. // If someone sends ether to that contract, |