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

feat: Abstract-compatible subscription payment system #15

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

0xObsidian
Copy link

@0xObsidian 0xObsidian commented Dec 19, 2024

Description

  • Manages plans and subscriptions
  • Smart wallet for automated payments

Includes ECDSA validation, reentrancy protection, and OpenZeppelin security features.

Available tests

  • Full test coverage.
  Security Tests
    Access Control
      ✔ Should prevent non-owners from creating plans (886ms)
      ✔ Should prevent non-owners from withdrawing funds
      ✔ Should prevent non-owners from managing subscriptions
    Reentrancy Protection
      ✔ Should prevent reentrant subscription creation
      ✔ Should prevent reentrant payment processing
    Payment Security
      ✔ Should prevent processing payments before due date
      ✔ Should prevent processing payments for inactive subscriptions
      ✔ Should prevent processing payments for inactive plans
    Fund Security
      ✔ Should prevent withdrawal when balance is zero
      ✔ Should ensure subscription payments are exact

  SubscriptionAccount
    Core Functionality
      Account Setup
        ✔ Should have correct owner (66ms)
        ✔ Should have correct registry
      Subscription Management
        ✔ Should allow owner to subscribe to a plan
        ✔ Should allow owner to cancel subscription
      Payment Processing
        ✔ Should process payment successfully

  SubscriptionRegistry
    Plan Management
      ✔ Should create a plan (42ms)
      ✔ Should revert if interval is zero
      ✔ Should revert if amount is zero
    Subscription Management
      ✔ Should allow subscription to a plan
      ✔ Should revert if already subscribed
      ✔ Should allow cancellation of subscription
      ✔ Should revert cancellation if no active subscription
    Payment Processing
      ✔ Should process payment when due
    Withdrawal
      ✔ Should allow owner to withdraw funds

  24 passing (1s)

Usage

Clone this PR branch and check README.md.

Copy link

vercel bot commented Dec 19, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
agw-connectkit-demo ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 19, 2024 2:35pm
agw-rainbowkit ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 19, 2024 2:35pm

Copy link

vercel bot commented Dec 19, 2024

@0xObsidian is attempting to deploy a commit to the Abstract Foundation Team on Vercel.

A member of the Team first needs to authorize it.

Description
-----------
- SubscriptionRegistry: Manages plans and subscriptions
- SubscriptionAccount: Smart wallet for automated payments
- Full test coverage.

Includes ECDSA validation, reentrancy protection, and
OpenZeppelin security features.

Usage
-----
Please check `README.md`.
@0xObsidian 0xObsidian force-pushed the 0xObsidian/impl-subscription-smart-contract branch from 57c82c3 to 0009628 Compare December 19, 2024 06:28
@0xObsidian 0xObsidian changed the title feat: abs-compatible subscription payment system feat: Abstract-compatible subscription payment system Dec 19, 2024
Description
-----------
- Updated .prettierrc config.
- Updated Hardhat config to include TypeChain and Ethers plugins.
- Improved clean-script to now removes node_modules for a complete reset.
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