-
-
Notifications
You must be signed in to change notification settings - Fork 107
Expand file tree
/
Copy pathTypes.sol
More file actions
96 lines (86 loc) · 2.32 KB
/
Types.sol
File metadata and controls
96 lines (86 loc) · 2.32 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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
// SPDX-License-Identifier: MIT AND Apache-2.0
pragma solidity 0.8.23;
import { PackedUserOperation } from "@account-abstraction/interfaces/PackedUserOperation.sol";
import { Execution } from "@erc7579/interfaces/IERC7579Account.sol";
import { ModeCode, CallType, ExecType, ModeSelector, ModePayload } from "@erc7579/lib/ModeLib.sol";
/**
* @title EIP712Domain
* @notice Struct representing the EIP712 domain for signature validation.
*/
struct EIP712Domain {
string name;
string version;
uint256 chainId;
address verifyingContract;
}
/**
* @title Delegation
* @notice Struct representing a delegation to give a delegate authority to act on behalf of a delegator.
* @dev `signature` is ignored during delegation hashing so it can be manipulated post signing.
* @dev Can be represented in a human-readable format using ReadableDelegation and ReadableTerm.
*/
/**
* @title ReadableDelegation
* @notice Human-readable version of a Delegation that uses string permission names and parameters.
*/
struct ReadableDelegation {
address delegate;
address delegator;
bytes32 authority;
ReadableTerm[] readableTerms;
uint256 salt;
bytes signature;
}
/**
* @title ReadableTerm
* @notice Human-readable version of a Caveat that uses string permission names and parameters.
*/
struct ReadableTerm {
string permissionName;
Parameter[] parameters;
bytes args;
}
/**
* @title Parameter
* @notice Name-value pair for readable delegation parameters.
*/
struct Parameter {
string name;
string value;
}
/**
struct Delegation {
address delegate;
address delegator;
bytes32 authority;
Caveat[] caveats;
uint256 salt;
bytes signature;
}
/**
* @title Caveat
* @notice Struct representing a caveat to enforce on a delegation.
* @dev `args` is ignored during caveat hashing so it can be manipulated post signing.
*/
struct Caveat {
address enforcer;
bytes terms;
bytes args;
}
/**
* @title P256 Public Key
* @notice Struct containing the X and Y coordinates of a P256 public key.
*/
struct P256PublicKey {
uint256 x;
uint256 y;
}
struct DecodedWebAuthnSignature {
uint256 r;
uint256 s;
bytes authenticatorData;
bool requireUserVerification;
string clientDataJSONPrefix;
string clientDataJSONSuffix;
uint256 responseTypeLocation;
}