Skip to content

Commit

Permalink
fix: propagate user op validation reverts from plugins
Browse files Browse the repository at this point in the history
  • Loading branch information
jaypaik committed Jan 24, 2024
1 parent e23153e commit ef05385
Showing 1 changed file with 3 additions and 14 deletions.
17 changes: 3 additions & 14 deletions src/account/UpgradeableModularAccount.sol
Original file line number Diff line number Diff line change
Expand Up @@ -365,13 +365,7 @@ contract UpgradeableModularAccount is

if (!preUserOpValidationHook.isEmptyOrMagicValue()) {
(address plugin, uint8 functionId) = preUserOpValidationHook.unpack();
try IPlugin(plugin).preUserOpValidationHook(functionId, userOp, userOpHash) returns (
uint256 returnData
) {
currentValidationData = returnData;
} catch {
currentValidationData = SIG_VALIDATION_FAILED;
}
currentValidationData = IPlugin(plugin).preUserOpValidationHook(functionId, userOp, userOpHash);

if (uint160(currentValidationData) > 1) {
// If the aggregator is not 0 or 1, it is an unexpected value
Expand All @@ -392,13 +386,8 @@ contract UpgradeableModularAccount is
{
if (!userOpValidationFunction.isEmptyOrMagicValue()) {
(address plugin, uint8 functionId) = userOpValidationFunction.unpack();
try IPlugin(plugin).userOpValidationFunction(functionId, userOp, userOpHash) returns (
uint256 returnData
) {
currentValidationData = returnData;
} catch {
currentValidationData = SIG_VALIDATION_FAILED;
}
currentValidationData = IPlugin(plugin).userOpValidationFunction(functionId, userOp, userOpHash);

if (preUserOpValidationHooksLength != 0) {
// If we have other validation data we need to coalesce with
validationData = _coalesceValidation(validationData, currentValidationData);
Expand Down

0 comments on commit ef05385

Please sign in to comment.