Skip to content

Commit

Permalink
fix: Cleanup comments, unused vars, config files. (#114)
Browse files Browse the repository at this point in the history
  • Loading branch information
adam-alchemy authored Jan 23, 2024
1 parent 80c8803 commit 4199f10
Show file tree
Hide file tree
Showing 88 changed files with 175 additions and 177 deletions.
2 changes: 1 addition & 1 deletion .solhint-src.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"rules": {
"immutable-vars-naming": ["error"],
"no-unused-import": ["error"],
"compiler-version": ["error", ">=0.8.21"],
"compiler-version": ["error", ">=0.8.22"],
"func-visibility": ["error", { "ignoreConstructors": true }],
"max-line-length": ["error", 120],
"func-param-name-mixedcase": ["error"],
Expand Down
2 changes: 1 addition & 1 deletion .solhint-test.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"func-name-mixedcase": "off",
"immutable-vars-naming": ["error"],
"no-unused-import": ["error"],
"compiler-version": ["error", ">=0.8.21"],
"compiler-version": ["error", ">=0.8.22"],
"func-visibility": ["error", { "ignoreConstructors": true }],
"max-line-length": ["error", 120],
"max-states-count": ["warn", 30],
Expand Down
4 changes: 2 additions & 2 deletions script/Deploy.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
// option) any later version.
//
// This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the
// implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
// implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
// more details.
//
// You should have received a copy of the GNU General Public License along with this program. If not, see
// You should have received a copy of the GNU General Public License along with this program. If not, see
// <https://www.gnu.org/licenses/>.

pragma solidity ^0.8.22;
Expand Down
2 changes: 1 addition & 1 deletion slither.config.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"filter_paths": "lib"
"filter_paths": "(lib/|test/)"
}
4 changes: 2 additions & 2 deletions src/account/AccountExecutor.sol
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
// option) any later version.
//
// This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the
// implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
// implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
// more details.
//
// You should have received a copy of the GNU General Public License along with this program. If not, see
// You should have received a copy of the GNU General Public License along with this program. If not, see
// <https://www.gnu.org/licenses/>.

pragma solidity ^0.8.22;
Expand Down
4 changes: 2 additions & 2 deletions src/account/AccountLoupe.sol
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
// option) any later version.
//
// This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the
// implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
// implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
// more details.
//
// You should have received a copy of the GNU General Public License along with this program. If not, see
// You should have received a copy of the GNU General Public License along with this program. If not, see
// <https://www.gnu.org/licenses/>.

pragma solidity ^0.8.22;
Expand Down
4 changes: 2 additions & 2 deletions src/account/AccountStorageInitializable.sol
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
// option) any later version.
//
// This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the
// implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
// implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
// more details.
//
// You should have received a copy of the GNU General Public License along with this program. If not, see
// You should have received a copy of the GNU General Public License along with this program. If not, see
// <https://www.gnu.org/licenses/>.

pragma solidity ^0.8.22;
Expand Down
12 changes: 6 additions & 6 deletions src/account/AccountStorageV1.sol
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
// option) any later version.
//
// This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the
// implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
// implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
// more details.
//
// You should have received a copy of the GNU General Public License along with this program. If not, see
// You should have received a copy of the GNU General Public License along with this program. If not, see
// <https://www.gnu.org/licenses/>.

pragma solidity ^0.8.22;
Expand Down Expand Up @@ -40,15 +40,15 @@ contract AccountStorageV1 {
mapping(bytes24 => bool) callPermitted;
// keys = address(calling plugin), target address
mapping(IPlugin => mapping(address => PermittedExternalCallData)) permittedExternalCalls;
// For ERC165 introspection, each count indicates support from account or an installed plugin
// 0 indicate the account does not support the interface and all plugins that support this interface have
// been uninstalled
// For ERC165 introspection, each count indicates support from account or an installed plugin.
// 0 indicates the account does not support the interface and all plugins that support this interface have
// been uninstalled.
mapping(bytes4 => uint256) supportedInterfaces;
}

struct PluginData {
bool anyExternalAddressPermitted;
// boolean to indicate if the plugin can spend native tokens, if any of the execution function can spend
// A boolean to indicate if the plugin can spend native tokens, if any of the execution function can spend
// native tokens, a plugin is considered to be able to spend native tokens of the accounts
bool canSpendNativeToken;
bytes32 manifestHash;
Expand Down
4 changes: 2 additions & 2 deletions src/account/PluginManagerInternals.sol
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
// option) any later version.
//
// This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the
// implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
// implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
// more details.
//
// You should have received a copy of the GNU General Public License along with this program. If not, see
// You should have received a copy of the GNU General Public License along with this program. If not, see
// <https://www.gnu.org/licenses/>.

pragma solidity ^0.8.22;
Expand Down
5 changes: 2 additions & 3 deletions src/account/UpgradeableModularAccount.sol
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
// option) any later version.
//
// This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the
// implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
// implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
// more details.
//
// You should have received a copy of the GNU General Public License along with this program. If not, see
// You should have received a copy of the GNU General Public License along with this program. If not, see
// <https://www.gnu.org/licenses/>.

pragma solidity ^0.8.22;
Expand Down Expand Up @@ -86,7 +86,6 @@ contract UpgradeableModularAccount is
event ModularAccountInitialized(IEntryPoint indexed entryPoint);

error AlwaysDenyRule();
error AuthorizeUpgradeReverted(bytes revertReason);
error ExecFromPluginNotPermitted(address plugin, bytes4 selector);
error ExecFromPluginExternalNotPermitted(address plugin, address target, uint256 value, bytes data);
error NativeTokenSpendingNotPermitted(address plugin);
Expand Down
4 changes: 2 additions & 2 deletions src/factory/MultiOwnerMSCAFactory.sol
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
// option) any later version.
//
// This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the
// implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
// implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
// more details.
//
// You should have received a copy of the GNU General Public License along with this program. If not, see
// You should have received a copy of the GNU General Public License along with this program. If not, see
// <https://www.gnu.org/licenses/>.

pragma solidity ^0.8.22;
Expand Down
4 changes: 2 additions & 2 deletions src/factory/MultiOwnerTokenReceiverMSCAFactory.sol
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
// option) any later version.
//
// This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the
// implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
// implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
// more details.
//
// You should have received a copy of the GNU General Public License along with this program. If not, see
// You should have received a copy of the GNU General Public License along with this program. If not, see
// <https://www.gnu.org/licenses/>.

pragma solidity ^0.8.22;
Expand Down
4 changes: 2 additions & 2 deletions src/helpers/CastLib.sol
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
// option) any later version.
//
// This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the
// implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
// implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
// more details.
//
// You should have received a copy of the GNU General Public License along with this program. If not, see
// You should have received a copy of the GNU General Public License along with this program. If not, see
// <https://www.gnu.org/licenses/>.

pragma solidity ^0.8.22;
Expand Down
4 changes: 2 additions & 2 deletions src/helpers/FactoryHelpers.sol
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
// option) any later version.
//
// This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the
// implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
// implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
// more details.
//
// You should have received a copy of the GNU General Public License along with this program. If not, see
// You should have received a copy of the GNU General Public License along with this program. If not, see
// <https://www.gnu.org/licenses/>.

pragma solidity ^0.8.22;
Expand Down
4 changes: 2 additions & 2 deletions src/helpers/FunctionReferenceLib.sol
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
// option) any later version.
//
// This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the
// implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
// implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
// more details.
//
// You should have received a copy of the GNU General Public License along with this program. If not, see
// You should have received a copy of the GNU General Public License along with this program. If not, see
// <https://www.gnu.org/licenses/>.

pragma solidity ^0.8.22;
Expand Down
4 changes: 2 additions & 2 deletions src/helpers/KnownSelectors.sol
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
// option) any later version.
//
// This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the
// implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
// implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
// more details.
//
// You should have received a copy of the GNU General Public License along with this program. If not, see
// You should have received a copy of the GNU General Public License along with this program. If not, see
// <https://www.gnu.org/licenses/>.

pragma solidity ^0.8.22;
Expand Down
4 changes: 2 additions & 2 deletions src/helpers/ValidationDataHelpers.sol
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
// option) any later version.
//
// This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the
// implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
// implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
// more details.
//
// You should have received a copy of the GNU General Public License along with this program. If not, see
// You should have received a copy of the GNU General Public License along with this program. If not, see
// <https://www.gnu.org/licenses/>.

pragma solidity ^0.8.22;
Expand Down
2 changes: 1 addition & 1 deletion src/interfaces/IAccountInitializable.sol
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ pragma solidity ^0.8.22;
/// @title Account Initializable Interface
interface IAccountInitializable {
/// @notice Initialize the account with a set of plugins.
/// @dev No dependencies or hooks can be injected with this installation.
/// @dev No dependencies may be provided with this installation.
/// @param plugins The plugins to install.
/// @param pluginInitData The plugin init data for each plugin.
function initialize(address[] calldata plugins, bytes calldata pluginInitData) external;
Expand Down
2 changes: 1 addition & 1 deletion src/libraries/AssociatedLinkedListSetLib.sol
Original file line number Diff line number Diff line change
Expand Up @@ -466,7 +466,7 @@ library AssociatedLinkedListSetLib {

// This segment is memory-safe because it only uses the scratch space memory after the value of the free
// memory pointer.
// See https://docs.soliditylang.org/en/v0.8.21/assembly.html#memory-safety
// See https://docs.soliditylang.org/en/v0.8.22/assembly.html#memory-safety
assembly ("memory-safe") {
// Clean upper bits of arguments
associated := and(associated, 0xffffffffffffffffffffffffffffffffffffffff)
Expand Down
4 changes: 2 additions & 2 deletions src/libraries/LinkedListSetLib.sol
Original file line number Diff line number Diff line change
Expand Up @@ -263,11 +263,11 @@ library LinkedListSetLib {
// This is accomplished by first writing to memory after the free memory pointer,
// then updating the free memory pointer to cover the newly-allocated data.
// To the compiler, writes to memory after the free memory pointer are considered "memory safe".
// See https://docs.soliditylang.org/en/v0.8.21/assembly.html#memory-safety
// See https://docs.soliditylang.org/en/v0.8.22/assembly.html#memory-safety
// Stack variable lifting done when compiling with via-ir will only ever place variables into memory
// locations
// below the current free memory pointer, so it is safe to compile this library with via-ir.
// See https://docs.soliditylang.org/en/v0.8.21/yul.html#memoryguard
// See https://docs.soliditylang.org/en/v0.8.22/yul.html#memoryguard
assembly ("memory-safe") {
// It is critical that no other memory allocations occur between:
// - loading the value of the free memory pointer into `ret`
Expand Down
4 changes: 2 additions & 2 deletions src/plugins/BasePlugin.sol
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
// option) any later version.
//
// This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the
// implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
// implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
// more details.
//
// You should have received a copy of the GNU General Public License along with this program. If not, see
// You should have received a copy of the GNU General Public License along with this program. If not, see
// <https://www.gnu.org/licenses/>.

pragma solidity ^0.8.22;
Expand Down
4 changes: 2 additions & 2 deletions src/plugins/TokenReceiverPlugin.sol
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
// option) any later version.
//
// This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the
// implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
// implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
// more details.
//
// You should have received a copy of the GNU General Public License along with this program. If not, see
// You should have received a copy of the GNU General Public License along with this program. If not, see
// <https://www.gnu.org/licenses/>.

pragma solidity ^0.8.22;
Expand Down
4 changes: 2 additions & 2 deletions src/plugins/owner/IMultiOwnerPlugin.sol
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
// option) any later version.
//
// This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the
// implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
// implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
// more details.
//
// You should have received a copy of the GNU General Public License along with this program. If not, see
// You should have received a copy of the GNU General Public License along with this program. If not, see
// <https://www.gnu.org/licenses/>.

pragma solidity ^0.8.22;
Expand Down
4 changes: 2 additions & 2 deletions src/plugins/owner/MultiOwnerPlugin.sol
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
// option) any later version.
//
// This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the
// implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
// implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
// more details.
//
// You should have received a copy of the GNU General Public License along with this program. If not, see
// You should have received a copy of the GNU General Public License along with this program. If not, see
// <https://www.gnu.org/licenses/>.

pragma solidity ^0.8.22;
Expand Down
5 changes: 2 additions & 3 deletions src/plugins/session/ISessionKeyPlugin.sol
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
// option) any later version.
//
// This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the
// implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
// implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
// more details.
//
// You should have received a copy of the GNU General Public License along with this program. If not, see
// You should have received a copy of the GNU General Public License along with this program. If not, see
// <https://www.gnu.org/licenses/>.

pragma solidity ^0.8.22;
Expand Down Expand Up @@ -75,7 +75,6 @@ interface ISessionKeyPlugin {
error LengthMismatch();
error NativeTokenSpendLimitExceeded(address account, address sessionKey);
error SessionKeyNotFound(address sessionKey);
error UnableToRemove(address sessionKey);

// ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
// ┃ Execution functions ┃
Expand Down
4 changes: 2 additions & 2 deletions src/plugins/session/SessionKeyPlugin.sol
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
// option) any later version.
//
// This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the
// implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
// implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
// more details.
//
// You should have received a copy of the GNU General Public License along with this program. If not, see
// You should have received a copy of the GNU General Public License along with this program. If not, see
// <https://www.gnu.org/licenses/>.

pragma solidity ^0.8.22;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
// option) any later version.
//
// This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the
// implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
// implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
// more details.
//
// You should have received a copy of the GNU General Public License along with this program. If not, see
// You should have received a copy of the GNU General Public License along with this program. If not, see
// <https://www.gnu.org/licenses/>.

pragma solidity ^0.8.22;
Expand Down
Loading

0 comments on commit 4199f10

Please sign in to comment.