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

Crowdfund Command for Pagu #179

Open
2 of 7 tasks
b00f opened this issue Dec 25, 2024 · 0 comments
Open
2 of 7 tasks

Crowdfund Command for Pagu #179

b00f opened this issue Dec 25, 2024 · 0 comments

Comments

@b00f
Copy link
Contributor

b00f commented Dec 25, 2024

Description:

We aim to implement a new crowdfund command in Pagu, our internal bot for the Pactus blockchain. This feature will enable community engagement in crowdfunding campaigns to support the growth of the project. The command will consist of multiple subcommands with distinct functionalities, as described below. We will use NowPaymnet to facilate the payment gateway. An old implementation of NowPayment can be found here

Subcommands:

  1. Create

    • Purpose: Admin-only command to create a new crowdfunding campaign.
    • Details:
      • Accepts input as a JSON object, allowing templated configurations.
      • Validates input format; provides appropriate feedback for incorrectly formatted inputs.
      • Activation occurs only when a campaign is created and marked as "active."
  2. Info

    • Purpose: Displays details of the latest active crowdfunding campaign.
    • Details:
      • Fetches the latest record from the crowdfunding table with an "active" status.
      • Shows campaign details, including available packages (defined as a JSON object within the campaign record).
  3. Purchase

    • Purpose: Allows users to purchase a package from the active crowdfunding campaign.
    • Details:
      • Displays a dropdown menu with a list of available packages.
      • Records a new order in the database upon package selection, capturing:
        • User ID
        • User platform (Discord or Telegram)
        • Amount of coins to purchase
        • Amount of USDT to pay
        • Locktime for claiming transactions
        • Order ID from the NowPayment API
  4. Claim

    • Purpose: Allows users to claim purchased coins.
    • Details:
      • Checks the NowPayment for unpaid orders and determines their statuses.
      • Detects confirmed and paid orders and releases transactions accordingly:
        • Based on specified PAC amount and locktime.
        • Updates the order status to "paid."
  5. History

    • Purpose: Displays the order history for a specific user.
    • Details:
      • Fetches and displays a complete list of the user's orders from the database.
  6. Disable

    • Purpose: Admin-only command to disable the currently active crowdfunding campaign.
    • Details:
      • Updates the campaign status to "inactive" in the database.
  7. Report

    • Purpose: Admin-only command to make a report regarding a specific crowdfund campaign..
    • Details:
      • Show the report regarding the specific campaign.
      • Calling this command barely should list all campaigns (active and non active)

Sub-Issues:

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

No branches or pull requests

1 participant