Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

leave execution contract abstract + use interface in msa #24

Merged
merged 2 commits into from
Mar 12, 2024

Conversation

livingrockrises
Copy link
Contributor

@livingrockrises livingrockrises commented Mar 11, 2024

Abstract contracts methods are left virtual empty
Abstract contracts implement tiny interfaces
these tiny interfaces make up huge interface for IModularSmartAccount which is reused in implementation (in order to do this methods are overridden by specifying abstract class and interface both)

Copy link

🤖 Slither Analysis Report 🔎

Slither report

Slither report

THIS CHECKLIST IS NOT COMPLETE. Use --show-ignored-findings to show all the results.
Summary
🔴 - name-reused (1 results) (High)
🟡 - unused-return (3 results) (Medium)
🔵 - shadowing-local (1 results) (Low)
🔵 - missing-zero-check (1 results) (Low)
🔵 - reentrancy-events (2 results) (Low)
ℹ️ - assembly (9 results) (Informational)
ℹ️ - dead-code (6 results) (Informational)
ℹ️ - low-level-calls (1 results) (Informational)
ℹ️ - naming-convention (1 results) (Informational)
ℹ️ - redundant-statements (1 results) (Informational)

name-reused

🔴 Impact: High
🔴 Confidence: High

interfaces/base/IHookManager.sol#L8-L11

unused-return

🟡 Impact: Medium
🟡 Confidence: Medium

  • ID-1
    SmartAccount.execute(ModeCode,bytes) ignores return value by (callType,execType) = mode.decode()

SmartAccount.sol#L44-L75

  • ID-2
    SmartAccount.executeFromExecutor(ModeCode,bytes) ignores return value by (callType,execType) = mode.decode()

SmartAccount.sol#L77-L127

  • ID-3
    SmartAccount.supportsExecutionMode(ModeCode) ignores return value by (callType,execType) = mode.decode()

SmartAccount.sol#L175-L189

shadowing-local

🔵 Impact: Low
🔴 Confidence: High

SmartAccount.sol#L31

missing-zero-check

🔵 Impact: Low
🟡 Confidence: Medium

factory/AccountFactory.sol#L11

reentrancy-events

🔵 Impact: Low
🟡 Confidence: Medium

SmartAccount.sol#L140-L152

SmartAccount.sol#L154-L165

assembly

ℹ️ Impact: Informational
🔴 Confidence: High

base/AccountExecution.sol#L87-L103

base/Storage.sol#L18-L22

  • ID-10
    SmartAccount.validateUserOp(PackedUserOperation,bytes32,uint256) uses assembly
    • INLINE ASM

SmartAccount.sol#L25-L42

base/AccountExecution.sol#L69-L84

base/AccountExecution.sol#L48-L67

lib/ModeLib.sol#L120-L124

base/AccountExecution.sol#L106-L121

lib/ModeLib.sol#L87-L100

lib/ExecLib.sol#L11-L27

dead-code

ℹ️ Impact: Informational
🟡 Confidence: Medium

base/ModuleManager.sol#L92-L96

lib/ModeLib.sol#L139-L141

base/AccountExecution.sol#L87-L103

base/AccountExecution.sol#L36-L46

base/AccountExecution.sol#L69-L84

base/AccountExecution.sol#L106-L121

low-level-calls

ℹ️ Impact: Informational
🔴 Confidence: High

  • ID-23
    🔵 Low level call in SmartAccount.executeUserOp(PackedUserOperation,bytes32):
    • (success) = address(this).delegatecall(callData)

SmartAccount.sol#L131-L138

naming-convention

ℹ️ Impact: Informational
🔴 Confidence: High

factory/AccountFactory.sol#L9

redundant-statements

ℹ️ Impact: Informational
🔴 Confidence: High

  • ID-25
    Redundant expression "additionalContext" inSmartAccount

SmartAccount.sol#L196

This comment was automatically generated by the GitHub Actions workflow.

Copy link

codecov bot commented Mar 11, 2024

Codecov Report

Attention: Patch coverage is 33.33333% with 26 lines in your changes are missing coverage. Please review.

❗ No coverage uploaded for pull request base (feat/phase-1-implementations@9a8e952). Click here to learn what that means.

Files Patch % Lines
contracts/SmartAccount.sol 38.23% 21 Missing ⚠️
contracts/base/ERC4337Account.sol 0.00% 4 Missing ⚠️
contracts/lib/ExecLib.sol 0.00% 1 Missing ⚠️
Additional details and impacted files
@@                       Coverage Diff                       @@
##             feat/phase-1-implementations      #24   +/-   ##
===============================================================
  Coverage                                ?   34.84%           
===============================================================
  Files                                   ?       11           
  Lines                                   ?      221           
  Branches                                ?       28           
===============================================================
  Hits                                    ?       77           
  Misses                                  ?      144           
  Partials                                ?        0           
Flag Coverage Δ
foundry 34.84% <33.33%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@livingrockrises livingrockrises changed the title leave execution contract abstract + use interface in msa (DIFF) leave execution contract abstract + use interface in msa Mar 12, 2024
@livingrockrises
Copy link
Contributor Author

Abstract contracts methods are left virtual empty

We could try and implement most of the methods and leave some and still keep it abstract
If all can be implemented, still leave virtual and make contract non-abstract (discussed with Adam)

some methods require modifiers from other abstract classes or defined in child class hence they could not be fully implemented.

what else can be done is implement methods with inner internal methods that can be left virtual / revert("not implemented") if modifier is not a problem.

@livingrockrises livingrockrises merged commit 0d723d4 into feat/phase-1-implementations Mar 12, 2024
6 of 9 checks passed
@livingrockrises livingrockrises deleted the refactor/structure branch March 12, 2024 13:31
Aboudjem added a commit that referenced this pull request Aug 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant