Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"solidity.packageDefaultDependenciesContractsDirectory": "src",
"solidity.packageDefaultDependenciesDirectory": "lib",
"solidity.compileUsingRemoteVersion": "v0.8.19",
"solidity.compileUsingRemoteVersion": "v0.8.25",
"editor.formatOnSave": true,
"[solidity]": {
"editor.defaultFormatter": "JuanBlanco.solidity"
Expand Down
2 changes: 1 addition & 1 deletion foundry.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[profile.default]
solc = '0.8.19'
solc = '0.8.25'
via_ir = false
src = 'src'
test = 'test'
Expand Down
2 changes: 1 addition & 1 deletion src/account/AccountExecutor.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.8.19;
pragma solidity ^0.8.25;

import {ERC165Checker} from "@openzeppelin/contracts/utils/introspection/ERC165Checker.sol";
import {IPlugin} from "../interfaces/IPlugin.sol";
Expand Down
19 changes: 5 additions & 14 deletions src/account/AccountLoupe.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.8.19;
pragma solidity ^0.8.25;

import {UUPSUpgradeable} from "@openzeppelin/contracts/proxy/utils/UUPSUpgradeable.sol";
import {EnumerableMap} from "@openzeppelin/contracts/utils/structs/EnumerableMap.sol";
Expand All @@ -14,8 +14,6 @@ abstract contract AccountLoupe is IAccountLoupe {
using EnumerableMap for EnumerableMap.Bytes32ToUintMap;
using EnumerableSet for EnumerableSet.AddressSet;

error ManifestDiscrepancy(address plugin);

/// @inheritdoc IAccountLoupe
function getExecutionFunctionConfig(bytes4 selector)
external
Expand Down Expand Up @@ -47,32 +45,30 @@ abstract contract AccountLoupe is IAccountLoupe {
uint256 maxExecHooksLength = postOnlyExecHooksLength;

// There can only be as many associated post hooks to run as there are pre hooks.
for (uint256 i = 0; i < preExecHooksLength;) {
for (uint256 i = 0; i < preExecHooksLength; ++i) {
(, uint256 count) = selectorData.preHooks.at(i);
unchecked {
maxExecHooksLength += (count + 1);
++i;
}
}

// Overallocate on length - not all of this may get filled up. We set the correct length later.
execHooks = new ExecutionHooks[](maxExecHooksLength);
uint256 actualExecHooksLength;

for (uint256 i = 0; i < preExecHooksLength;) {
for (uint256 i = 0; i < preExecHooksLength; ++i) {
(bytes32 key,) = selectorData.preHooks.at(i);
FunctionReference preExecHook = FunctionReference.wrap(bytes21(key));

uint256 associatedPostExecHooksLength = selectorData.associatedPostHooks[preExecHook].length();
if (associatedPostExecHooksLength > 0) {
for (uint256 j = 0; j < associatedPostExecHooksLength;) {
for (uint256 j = 0; j < associatedPostExecHooksLength; ++j) {
execHooks[actualExecHooksLength].preExecHook = preExecHook;
(key,) = selectorData.associatedPostHooks[preExecHook].at(j);
execHooks[actualExecHooksLength].postExecHook = FunctionReference.wrap(bytes21(key));

unchecked {
++actualExecHooksLength;
++j;
}
}
} else {
Expand All @@ -82,19 +78,14 @@ abstract contract AccountLoupe is IAccountLoupe {
++actualExecHooksLength;
}
}

unchecked {
++i;
}
}

for (uint256 i = 0; i < postOnlyExecHooksLength;) {
for (uint256 i = 0; i < postOnlyExecHooksLength; ++i) {
(bytes32 key,) = selectorData.postOnlyHooks.at(i);
execHooks[actualExecHooksLength].postExecHook = FunctionReference.wrap(bytes21(key));

unchecked {
++actualExecHooksLength;
++i;
}
}

Expand Down
8 changes: 2 additions & 6 deletions src/account/AccountStorage.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.8.19;
pragma solidity ^0.8.25;

import {EnumerableMap} from "@openzeppelin/contracts/utils/structs/EnumerableMap.sol";
import {EnumerableSet} from "@openzeppelin/contracts/utils/structs/EnumerableSet.sol";
Expand Down Expand Up @@ -83,13 +83,9 @@ function toFunctionReferenceArray(EnumerableMap.Bytes32ToUintMap storage map)
{
uint256 length = map.length();
FunctionReference[] memory result = new FunctionReference[](length);
for (uint256 i = 0; i < length;) {
for (uint256 i = 0; i < length; ++i) {
(bytes32 key,) = map.at(i);
result[i] = FunctionReference.wrap(bytes21(key));

unchecked {
++i;
}
}
return result;
}
2 changes: 1 addition & 1 deletion src/account/AccountStorageInitializable.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.8.19;
pragma solidity ^0.8.25;

import {Address} from "@openzeppelin/contracts/utils/Address.sol";

Expand Down
Loading