aboutsummaryrefslogtreecommitdiffstats
path: root/docs/contracts.rst
diff options
context:
space:
mode:
authorDaniel Kirchner <daniel@ekpyron.org>2018-08-06 20:59:37 +0800
committerDaniel Kirchner <daniel@ekpyron.org>2018-08-13 20:27:01 +0800
commit7d7abeb1496dddfab7eb8705dbfc3d06284cf25d (patch)
tree2909fe73439256e0f77231ec219b1b9af6fefd5a /docs/contracts.rst
parent43db88b8363d73ee2f5ffa094ff506414261bd11 (diff)
downloaddexon-solidity-7d7abeb1496dddfab7eb8705dbfc3d06284cf25d.tar.gz
dexon-solidity-7d7abeb1496dddfab7eb8705dbfc3d06284cf25d.tar.zst
dexon-solidity-7d7abeb1496dddfab7eb8705dbfc3d06284cf25d.zip
Disallow ambiguous conversions between number literals and bytesXX types.
Diffstat (limited to 'docs/contracts.rst')
-rw-r--r--docs/contracts.rst7
1 files changed, 3 insertions, 4 deletions
diff --git a/docs/contracts.rst b/docs/contracts.rst
index 561d2f97..e9ac1af7 100644
--- a/docs/contracts.rst
+++ b/docs/contracts.rst
@@ -114,8 +114,7 @@ This means that cyclic creation dependencies are impossible.
returns (bool ok)
{
// Check some arbitrary condition.
- address tokenAddress = msg.sender;
- return (keccak256(abi.encodePacked(newOwner)) & 0xff) == (bytes20(tokenAddress) & 0xff);
+ return currentOwner != newOwner;
}
}
@@ -811,12 +810,12 @@ as topics. The event call above can be performed in the same way as
contract C {
function f() public payable {
- bytes32 _id = 0x420042;
+ uint256 _id = 0x420042;
log3(
bytes32(msg.value),
bytes32(0x50cb9fe53daa9737b786ab3646f04d0150dc50ef4e75f59509d83667ad5adb20),
bytes32(uint256(msg.sender)),
- _id
+ bytes32(_id)
);
}
}