aboutsummaryrefslogtreecommitdiffstats
path: root/docs
diff options
context:
space:
mode:
authorchriseth <chris@ethereum.org>2018-08-13 23:25:30 +0800
committerGitHub <noreply@github.com>2018-08-13 23:25:30 +0800
commitae8218543b91a98663ab98de3200a0eec2bfebe3 (patch)
tree142f8a34907ad0ebd79abfb18dedaac1fa4aa58c /docs
parent463f4b0f35a9eb930a4cce164135d726c091c50e (diff)
parent7d7abeb1496dddfab7eb8705dbfc3d06284cf25d (diff)
downloaddexon-solidity-ae8218543b91a98663ab98de3200a0eec2bfebe3.tar.gz
dexon-solidity-ae8218543b91a98663ab98de3200a0eec2bfebe3.tar.zst
dexon-solidity-ae8218543b91a98663ab98de3200a0eec2bfebe3.zip
Merge pull request #4696 from ethereum/byteLiteralConversion
Disallow ambiguous implicit and explicit conversions from number literals to bytesXX
Diffstat (limited to 'docs')
-rw-r--r--docs/abi-spec.rst2
-rw-r--r--docs/contracts.rst7
-rw-r--r--docs/types.rst2
3 files changed, 5 insertions, 6 deletions
diff --git a/docs/abi-spec.rst b/docs/abi-spec.rst
index 3c593e54..69bbe5c3 100644
--- a/docs/abi-spec.rst
+++ b/docs/abi-spec.rst
@@ -444,7 +444,7 @@ For example,
pragma solidity >0.4.24;
contract Test {
- constructor() public { b = 0x12345678901234567890123456789012; }
+ constructor() public { b = hex"12345678901234567890123456789012"; }
event Event(uint indexed a, bytes32 b);
event Event2(uint indexed a, bytes32 b);
function foo(uint a) public { emit Event(a, b); }
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)
);
}
}
diff --git a/docs/types.rst b/docs/types.rst
index 5efb24e3..7e222bc1 100644
--- a/docs/types.rst
+++ b/docs/types.rst
@@ -786,7 +786,7 @@ Members
// but can be treated identical to "uint8[]"
m_byteData = data;
m_byteData.length += 7;
- m_byteData[3] = byte(8);
+ m_byteData[3] = 0x08;
delete m_byteData[2];
}