@@ -75,7 +75,17 @@ contract AccountCore is IAccountCore, Initializable, Multicall, BaseAccount, Acc
75
75
return entrypointContract;
76
76
}
77
77
78
- /// @notice Returns whether a signer is authorized to perform transactions using the wallet.
78
+ /**
79
+ @notice Returns whether a signer is authorized to perform transactions using the account.
80
+ Validity of the signature is based upon signer permission start/end timestamps, txn target, and txn value.
81
+ Account admins will always return true, and signers with address(0) as the only approved target will skip target checks.
82
+
83
+ @param _signer The signer to check.
84
+ @param _userOp The user operation to check.
85
+
86
+ @return Whether the signer is authorized to perform the transaction.
87
+ */
88
+
79
89
/* solhint-disable*/
80
90
function isValidSigner (address _signer , UserOperation calldata _userOp ) public view virtual returns (bool ) {
81
91
// First, check if the signer is an admin.
@@ -102,6 +112,7 @@ contract AccountCore is IAccountCore, Initializable, Multicall, BaseAccount, Acc
102
112
// if address(0) is the only approved target, set isWildCard to true (wildcard approved).
103
113
bool isWildCard = approvedTargets.length () == 1 && approvedTargets.at (0 ) == address (0 );
104
114
115
+ // checking target and value for `execute`
105
116
if (sig == AccountExtension.execute.selector ) {
106
117
// Extract the `target` and `value` arguments from the calldata for `execute`.
107
118
(address target , uint256 value ) = decodeExecuteCalldata (_userOp.callData);
@@ -115,12 +126,14 @@ contract AccountCore is IAccountCore, Initializable, Multicall, BaseAccount, Acc
115
126
}
116
127
}
117
128
118
- // Check if the value is within the allowed range and if the target is approved .
129
+ // Check if the value is within the allowed range.
119
130
if (permissions.nativeTokenLimitPerTransaction < value) {
120
131
// Account: value too high OR Account: target not approved.
121
132
return false ;
122
133
}
123
- } else if (sig == AccountExtension.executeBatch.selector ) {
134
+ }
135
+ // checking target and value for `executeBatch`
136
+ else if (sig == AccountExtension.executeBatch.selector ) {
124
137
// Extract the `target` and `value` array arguments from the calldata for `executeBatch`.
125
138
(address [] memory targets , uint256 [] memory values , ) = decodeExecuteBatchCalldata (_userOp.callData);
126
139
@@ -134,7 +147,7 @@ contract AccountCore is IAccountCore, Initializable, Multicall, BaseAccount, Acc
134
147
}
135
148
}
136
149
137
- // For each target+value pair, check if the value is within the allowed range and if the target is approved .
150
+ // For each target+value pair, check if the value is within the allowed range.
138
151
for (uint256 i = 0 ; i < targets.length ; i++ ) {
139
152
if (permissions.nativeTokenLimitPerTransaction < values[i]) {
140
153
// Account: value too high OR Account: target not approved.
0 commit comments