forked from hiero-ledger/hiero-contracts
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEcrecoverCaller.sol
More file actions
33 lines (28 loc) · 1.09 KB
/
Copy pathEcrecoverCaller.sol
File metadata and controls
33 lines (28 loc) · 1.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
// SPDX-License-Identifier: Apache-2.0
pragma solidity >=0.5.0 <0.9.0;
contract EcrecoverCaller {
event EcrecoverResult(bytes result);
address accountZeroZeroOne = address(0x0000000000000000000000000000000000000001);
function callEcrecover(bytes32 messageHash, uint8 v, bytes32 r, bytes32 s) external pure returns (address) {
address result = ecrecover(messageHash, v, r, s);
return result;
}
function call0x1(bytes calldata callData) external payable returns (bool) {
address target = accountZeroZeroOne;
(bool success, bytes memory result) = target.call{value: msg.value}(callData);
if (!success) {
revert();
}
emit EcrecoverResult(result);
return success;
}
function send0x1() external payable returns (bool) {
address payable target = payable(accountZeroZeroOne);
bool success = target.send(msg.value);
return success;
}
function transfer0x1() external payable {
address payable target = payable(accountZeroZeroOne);
target.transfer(msg.value);
}
}