Use bytes.concat in MessageHashUtils (#4504)
This commit is contained in:
@ -2,4 +2,6 @@
|
|||||||
'openzeppelin-solidity': minor
|
'openzeppelin-solidity': minor
|
||||||
---
|
---
|
||||||
|
|
||||||
Replace some uses of `abi.encodePacked` with clearer alternatives (e.g. `bytes.concat`, `string.concat`).
|
Replace some uses of `abi.encodePacked` with clearer alternatives (e.g. `bytes.concat`, `string.concat`). (#4504)[https://github.com/OpenZeppelin/openzeppelin-contracts/pull/4504]
|
||||||
|
|
||||||
|
pr: #4296
|
||||||
|
|||||||
@ -46,7 +46,8 @@ library MessageHashUtils {
|
|||||||
* See {ECDSA-recover}.
|
* See {ECDSA-recover}.
|
||||||
*/
|
*/
|
||||||
function toEthSignedMessageHash(bytes memory message) internal pure returns (bytes32 digest) {
|
function toEthSignedMessageHash(bytes memory message) internal pure returns (bytes32 digest) {
|
||||||
return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n", Strings.toString(message.length), message));
|
return
|
||||||
|
keccak256(bytes.concat("\x19Ethereum Signed Message:\n", bytes(Strings.toString(message.length)), message));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user