bcnmy / nexus

Nexus by Biconomy: ERC-7579 Modular Smart Account for Enhanced Account Abstraction
https://github.com/bcnmy/nexus/wiki
MIT License
27 stars 5 forks source link

Fix/cantina 62 #182

Closed livingrockrises closed 1 month ago

livingrockrises commented 1 month ago

Storage contract defines all storage variables to be used within the nexus smart account.

Nexus inherits from ModuleManager and BaseAccount, and both of them inherit from this storage contract. This creates a convoluted inheritance pattern.

BaseAccount/ ModuleManager is not intended to be used separately and thus only one of these needs inheritance from storage, for the nexus account to be able to access it.

FIX

Remove Storage contract from the inheritance declaration of BaseAccount contract Move _ENTRYPOINT var to BaseAccount. it's doable now cause ModuleManager now doesn't have any modifier that requires _ENTRYPOINT.

github-actions[bot] commented 1 month ago

Changes to gas cost

Generated at commit: bf99cbae8cdca2b1a12839560802c679e01f4500, compared to commit: 63f76d1c6c21e949210499dfdb51015f2fd6f5bc

🧾 Summary (5% most significant diffs)

Contract Method Avg (+/-) %

Full diff report 👇
| Contract | Deployment Cost (+/-) | Method | Min (+/-) | % | Avg (+/-) | % | Median (+/-) | % | Max (+/-) | % | # Calls (+/-) | |:-|-:|:-|-:|-:|-:|-:|-:|-:|-:|-:|-:| | **Bootstrap** | 1,930,417 (-145) | | | | | | | | | | |
codecov[bot] commented 1 month ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 94.86%. Comparing base (63f76d1) to head (d87cef9). Report is 4 commits behind head on dev.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## dev #182 +/- ## ======================================= Coverage 94.86% 94.86% ======================================= Files 14 14 Lines 721 721 Branches 164 139 -25 ======================================= Hits 684 684 Misses 37 37 ``` | [Files with missing lines](https://app.codecov.io/gh/bcnmy/nexus/pull/182?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=bcnmy) | Coverage Δ | | |---|---|---| | [contracts/base/BaseAccount.sol](https://app.codecov.io/gh/bcnmy/nexus/pull/182?src=pr&el=tree&filepath=contracts%2Fbase%2FBaseAccount.sol&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=bcnmy#diff-Y29udHJhY3RzL2Jhc2UvQmFzZUFjY291bnQuc29s) | `100.00% <ø> (ø)` | | | [contracts/base/Storage.sol](https://app.codecov.io/gh/bcnmy/nexus/pull/182?src=pr&el=tree&filepath=contracts%2Fbase%2FStorage.sol&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=bcnmy#diff-Y29udHJhY3RzL2Jhc2UvU3RvcmFnZS5zb2w=) | `100.00% <ø> (ø)` | | ------ [Continue to review full report in Codecov by Sentry](https://app.codecov.io/gh/bcnmy/nexus/pull/182?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=bcnmy). > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=bcnmy) > `Δ = absolute (impact)`, `ø = not affected`, `? = missing data` > Powered by [Codecov](https://app.codecov.io/gh/bcnmy/nexus/pull/182?dropdown=coverage&src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=bcnmy). Last update [63f76d1...d87cef9](https://app.codecov.io/gh/bcnmy/nexus/pull/182?dropdown=coverage&src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=bcnmy). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=bcnmy).
github-actions[bot] commented 1 month ago

:robot: Slither Analysis Report :mag_right:

Slither report

# Slither report **THIS CHECKLIST IS NOT COMPLETE**. Use `--show-ignored-findings` to show all the results. Summary :yellow_circle: - [unused-return](#unused-return) (1 results) (Medium) - [constable-states](#constable-states) (2 results) (Optimization) ## unused-return :yellow_circle: Impact: Medium :yellow_circle: Confidence: Medium - [ ] ID-0 [ERC7739Validator._hashTypedDataForAccount(address,bytes32)]([base/ERC7739Validator.sol#L176-L206](https://github.com/bcnmy/nexus/blob/bf99cbae8cdca2b1a12839560802c679e01f4500/contracts/contracts/base/ERC7739Validator.sol#L176-L206)) ignores return value by [(name,version,chainId,verifyingContract) = EIP712(account).eip712Domain()]([base/ERC7739Validator.sol#L177-L185](https://github.com/bcnmy/nexus/blob/bf99cbae8cdca2b1a12839560802c679e01f4500/contracts/contracts/base/ERC7739Validator.sol#L177-L185)) [base/ERC7739Validator.sol#L176-L206](https://github.com/bcnmy/nexus/blob/bf99cbae8cdca2b1a12839560802c679e01f4500/contracts/contracts/base/ERC7739Validator.sol#L176-L206) ## constable-states Impact: Optimization :red_circle: Confidence: High - [ ] ID-1 [RegistryAdapter.registry]([base/RegistryAdapter.sol#L10](https://github.com/bcnmy/nexus/blob/bf99cbae8cdca2b1a12839560802c679e01f4500/contracts/contracts/base/RegistryAdapter.sol#L10)) should be constant [base/RegistryAdapter.sol#L10](https://github.com/bcnmy/nexus/blob/bf99cbae8cdca2b1a12839560802c679e01f4500/contracts/contracts/base/RegistryAdapter.sol#L10) - [ ] ID-2 [RegistryFactory.threshold]([factory/RegistryFactory.sol#L39](https://github.com/bcnmy/nexus/blob/bf99cbae8cdca2b1a12839560802c679e01f4500/contracts/contracts/factory/RegistryFactory.sol#L39)) should be constant [factory/RegistryFactory.sol#L39](https://github.com/bcnmy/nexus/blob/bf99cbae8cdca2b1a12839560802c679e01f4500/contracts/contracts/factory/RegistryFactory.sol#L39)

This comment was automatically generated by the GitHub Actions workflow.