mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Simplify precompiles
This commit is contained in:
parent
12aa9e54cb
commit
a58fbba0db
@ -28,17 +28,11 @@ function ecrecover(bytes32 hash, uint8 v, bytes32 r, bytes32 s) returns (address
|
|||||||
mstore(add(input, 96), s)
|
mstore(add(input, 96), s)
|
||||||
|
|
||||||
// Prepare output
|
// Prepare output
|
||||||
let output := add(input, 128)
|
mstore(0, 0)
|
||||||
mstore(output, 0)
|
|
||||||
|
|
||||||
// Call the precompile
|
// Call the precompile
|
||||||
let ret := staticcall(gas(), 1, input, 128, output, 32)
|
let ret := staticcall(gas(), 1, input, 128, 0, 32)
|
||||||
switch ret
|
if iszero(ret) { revert(0, 0) }
|
||||||
case 1 { // Success
|
addr := mload(0)
|
||||||
addr := mload(output)
|
|
||||||
}
|
|
||||||
default { // Failure
|
|
||||||
// Need to do anything?
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user