-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathcommon.sol
39 lines (34 loc) · 883 Bytes
/
common.sol
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
34
35
36
37
38
39
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.10;
address constant lpAddress = address(
0x9552ceB4e6FA8c356c1A76A8Bc8b1EFA7B9fb205
);
struct Ticket {
/// Who will get the funds if executed
address l1Recipient;
/// The amount of funds to send.
uint256 value;
/// The timestamp when the ticket was registered
uint256 createdAt;
}
struct TicketsWithIndex {
uint256 startIndex;
Ticket[] tickets;
}
struct Signature {
bytes32 r;
bytes32 s;
uint8 v;
}
abstract contract SignatureChecker {
function recoverSigner(bytes32 hash, Signature memory signature)
public
pure
returns (address)
{
bytes32 prefixedHash = keccak256(
abi.encodePacked("\x19Ethereum Signed Message:\n32", hash)
);
return ecrecover(prefixedHash, signature.v, signature.r, signature.s);
}
}