diff options
author | Remco Bloemen <remco@wicked.ventures> | 2018-06-14 00:37:12 +0800 |
---|---|---|
committer | Remco Bloemen <remco@wicked.ventures> | 2018-06-23 19:53:38 +0800 |
commit | c66477c69097b15b90d9474222e308baeaa929a6 (patch) | |
tree | b5a2f4e1105baa82222c9100079b9185b602c1ee | |
parent | 5c612a186f6b6282323bc7172de22f43c511b8e4 (diff) | |
download | dexon-sol-tools-c66477c69097b15b90d9474222e308baeaa929a6.tar dexon-sol-tools-c66477c69097b15b90d9474222e308baeaa929a6.tar.gz dexon-sol-tools-c66477c69097b15b90d9474222e308baeaa929a6.tar.bz2 dexon-sol-tools-c66477c69097b15b90d9474222e308baeaa929a6.tar.lz dexon-sol-tools-c66477c69097b15b90d9474222e308baeaa929a6.tar.xz dexon-sol-tools-c66477c69097b15b90d9474222e308baeaa929a6.tar.zst dexon-sol-tools-c66477c69097b15b90d9474222e308baeaa929a6.zip |
Clean low bits in bytes4
-rw-r--r-- | packages/contracts/src/contracts/current/utils/LibBytes/LibBytes.sol | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/packages/contracts/src/contracts/current/utils/LibBytes/LibBytes.sol b/packages/contracts/src/contracts/current/utils/LibBytes/LibBytes.sol index c443dda8f..4a1397470 100644 --- a/packages/contracts/src/contracts/current/utils/LibBytes/LibBytes.sol +++ b/packages/contracts/src/contracts/current/utils/LibBytes/LibBytes.sol @@ -451,6 +451,9 @@ library LibBytes { ); assembly { result := mload(add(b, 32)) + // Solidity does not require us to clean the trailing bytes. + // We do it anyway + result := and(result, 0xFFFFFFFF00000000000000000000000000000000000000000000000000000000) } return result; } |