aboutsummaryrefslogtreecommitdiffstats
path: root/docs/contracts.rst
diff options
context:
space:
mode:
authorchriseth <chris@ethereum.org>2018-06-13 23:49:41 +0800
committerAlex Beregszaszi <alex@rtfs.hu>2018-06-25 23:17:18 +0800
commit17493e64ed986c33bb5562eabafca2d52b212f19 (patch)
tree25ac5961633e2813bd4a6bc53b883f690f61f506 /docs/contracts.rst
parent237788c0bc204eb08ba7000cd51c0c62ecb777c6 (diff)
downloaddexon-solidity-17493e64ed986c33bb5562eabafca2d52b212f19.tar.gz
dexon-solidity-17493e64ed986c33bb5562eabafca2d52b212f19.tar.zst
dexon-solidity-17493e64ed986c33bb5562eabafca2d52b212f19.zip
Documentation.
Diffstat (limited to 'docs/contracts.rst')
-rw-r--r--docs/contracts.rst6
1 files changed, 3 insertions, 3 deletions
diff --git a/docs/contracts.rst b/docs/contracts.rst
index 5e7eab80..19eba047 100644
--- a/docs/contracts.rst
+++ b/docs/contracts.rst
@@ -113,7 +113,7 @@ This means that cyclic creation dependencies are impossible.
{
// Check some arbitrary condition.
address tokenAddress = msg.sender;
- return (keccak256(newOwner) & 0xff) == (bytes20(tokenAddress) & 0xff);
+ return (keccak256(abi.encodePacked(newOwner)) & 0xff) == (bytes20(tokenAddress) & 0xff);
}
}
@@ -377,7 +377,7 @@ 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());
+ require(msg.sender.call(""));
return 7;
}
}
@@ -604,7 +604,7 @@ Like any function, the fallback function can execute complex operations as long
contract Caller {
function callTest(Test test) public {
- test.call(0xabcdef01); // hash does not exist
+ test.call(abi.encodeWithSignature("nonExistingFunction()"));
// results in test.x becoming == 1.
// The following will not compile, but even