Update Prettier Solidity (#3898)
This commit is contained in:
@ -98,11 +98,7 @@ library ECDSA {
|
||||
*
|
||||
* _Available since v4.3._
|
||||
*/
|
||||
function tryRecover(
|
||||
bytes32 hash,
|
||||
bytes32 r,
|
||||
bytes32 vs
|
||||
) internal pure returns (address, RecoverError) {
|
||||
function tryRecover(bytes32 hash, bytes32 r, bytes32 vs) internal pure returns (address, RecoverError) {
|
||||
bytes32 s = vs & bytes32(0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff);
|
||||
uint8 v = uint8((uint256(vs) >> 255) + 27);
|
||||
return tryRecover(hash, v, r, s);
|
||||
@ -113,11 +109,7 @@ library ECDSA {
|
||||
*
|
||||
* _Available since v4.2._
|
||||
*/
|
||||
function recover(
|
||||
bytes32 hash,
|
||||
bytes32 r,
|
||||
bytes32 vs
|
||||
) internal pure returns (address) {
|
||||
function recover(bytes32 hash, bytes32 r, bytes32 vs) internal pure returns (address) {
|
||||
(address recovered, RecoverError error) = tryRecover(hash, r, vs);
|
||||
_throwError(error);
|
||||
return recovered;
|
||||
@ -129,12 +121,7 @@ library ECDSA {
|
||||
*
|
||||
* _Available since v4.3._
|
||||
*/
|
||||
function tryRecover(
|
||||
bytes32 hash,
|
||||
uint8 v,
|
||||
bytes32 r,
|
||||
bytes32 s
|
||||
) internal pure returns (address, RecoverError) {
|
||||
function tryRecover(bytes32 hash, uint8 v, bytes32 r, bytes32 s) internal pure returns (address, RecoverError) {
|
||||
// EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature
|
||||
// unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines
|
||||
// the valid range for s in (301): 0 < s < secp256k1n ÷ 2 + 1, and for v in (302): v ∈ {27, 28}. Most
|
||||
@ -161,12 +148,7 @@ library ECDSA {
|
||||
* @dev Overload of {ECDSA-recover} that receives the `v`,
|
||||
* `r` and `s` signature fields separately.
|
||||
*/
|
||||
function recover(
|
||||
bytes32 hash,
|
||||
uint8 v,
|
||||
bytes32 r,
|
||||
bytes32 s
|
||||
) internal pure returns (address) {
|
||||
function recover(bytes32 hash, uint8 v, bytes32 r, bytes32 s) internal pure returns (address) {
|
||||
(address recovered, RecoverError error) = tryRecover(hash, v, r, s);
|
||||
_throwError(error);
|
||||
return recovered;
|
||||
|
||||
Reference in New Issue
Block a user