Skip to content

Commit

Permalink
fix: [spearbit-86] store sessionKeyData.contractAccessControlType in …
Browse files Browse the repository at this point in the history
…a local variable
  • Loading branch information
jaypaik committed Jan 8, 2024
1 parent 5493a3e commit ae27491
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions src/plugins/session/permissions/SessionKeyPermissionsPlugin.sol
Original file line number Diff line number Diff line change
Expand Up @@ -259,17 +259,18 @@ contract SessionKeyPermissionsPlugin is ISessionKeyPermissionsPlugin, SessionKey

uint256 callsLength = calls.length;
// Only return validation success when there is at least one call
bool validationSuccess = calls.length > 0;
for (uint256 i = 0; i < callsLength;) {
Call memory call = calls[i];
nativeTokenSpend += call.value;
validationSuccess = validationSuccess
&& _checkCallPermissions(
sessionKeyData.contractAccessControlType, keyId, call.target, call.value, call.data
);

unchecked {
++i;
bool validationSuccess = callsLength > 0;
{
ContractAccessControlType accessControlType = sessionKeyData.contractAccessControlType;
for (uint256 i = 0; i < callsLength;) {
Call memory call = calls[i];
nativeTokenSpend += call.value;
validationSuccess = validationSuccess
&& _checkCallPermissions(accessControlType, keyId, call.target, call.value, call.data);

unchecked {
++i;
}
}
}

Expand Down

0 comments on commit ae27491

Please sign in to comment.