kinto-core icon indicating copy to clipboard operation
kinto-core copied to clipboard

System apps

Open ylv-io opened this issue 6 months ago • 3 comments

Summary

This PR introduces several enhancements and fixes to the KintoAppRegistry, IKintoAppRegistry, IKintoWallet, and related contracts. The main changes include the addition of system app management, updates to the wallet execution logic, and improvements to the test coverage.

Implementation Details

  • KintoAppRegistry.sol

    • Added systemApps array and isSystemApp mapping to manage system applications.
    • Introduced updateSystemApps function to update the list of system apps.
    • Modified getSponsor function to getApp for better clarity.
    • Added getSystemApps function to retrieve the list of system apps.
  • SponsorPaymaster.sol

    • Updated getSponsor function call to getApp for consistency with the new naming convention.
  • KintoWallet.sol

    • Improved documentation and comments for better clarity.
    • Added systemApp check in _executeInner function to allow system apps to execute without being whitelisted.
    • Removed redundant privileged app checks and logic.
  • Tests

    • KintoAppRegistryTest
      • Added tests for updateSystemApps to ensure correct functionality and edge cases.
    • ExecuteTest
      • Added tests for executing transactions with system apps.
      • Improved existing tests to cover more scenarios.
    • ExecuteBatchTest
      • Added tests for batch execution with system apps.
    • ValidateSignatureTest
      • Removed tests related to privileged apps as the logic has been simplified.
    • WhitelistTest
      • Simplified tests for whitelisting apps and setting app keys.

Summary of Changes

  • Added system app management in KintoAppRegistry.
  • Updated wallet execution logic to support system apps.
  • Improved documentation and comments across multiple contracts.
  • Enhanced test coverage for new and existing functionalities.

Type of change

  • [ ] Bug fix
  • [x] New feature
  • [ ] Breaking change
  • [ ] Dependency changes
  • [ ] Deployment
  • [ ] Forge Script
  • [ ] Code refactor / cleanup
  • [ ] Documentation or wording changes
  • [ ] Other

Checklist:

  • [x] The diff is legible and has no extraneous changes
  • [x] Complex code has been commented, including external interfaces
  • [x] Tests have 100% code coverage
  • [x] The base branch is either main, or there's a description of how to merge

Issue Resolution

ylv-io avatar Aug 12 '24 22:08 ylv-io