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

Application Manager #3

Open
29 of 36 tasks
cyri113 opened this issue Jul 19, 2024 · 0 comments
Open
29 of 36 tasks

Application Manager #3

cyri113 opened this issue Jul 19, 2024 · 0 comments

Comments

@cyri113
Copy link
Contributor

cyri113 commented Jul 19, 2024

Application Manager

CRUD contract for applications.

Requirements

  • general
    • should inherit the OpenZepplin AccessManager.
  • interface
    • should define an Application struct with the following fields:
      • name (string)
      • account (address)
    • should define an external function createApplication
    • should define an external function updateApplication
    • should define an external function deleteApplication
    • should define an external function getApplication
    • should define an external function getApplications
    • should define an event CreateApplication
    • should define an event UpdateApplication
    • should define an event DeleteApplication
  • constructor
    • should set the accessManager_ as a AccessManager
  • state variables
    • should have a mapping applications from uint256 (application IDs) to Application structs.
    • should have a uint256 variable nextApplicationId to track the next application ID.
  • createApplication
    • should accept name (string) and account (address) as inputs.
    • should increment nextApplicationId.
    • should create a new Application struct with the provided name and account and store it in the applications mapping with the key as the new applicationId.
    • should emit the ApplicationCreated event with the new application's details.
    • should only be callable by accounts with the ADMIN_ROLE.
  • updateApplication
    • should accept applicationId (uint256), name (string), and account (address) as inputs.
    • should update the Application struct in the applications mapping with the provided applicationId to have the new name and account.
    • should emit the ApplicationUpdated event with the updated application's details.
    • should revert if the applicationId does not exist.
    • should only be callable by accounts with the ADMIN_ROLE.
  • deleteApplication
    • should accept applicationId (uint256) as an input.
    • should remove the Application struct from the applications mapping with the provided applicationId.
    • should emit the ApplicationDeleted event with the deleted application's ID.
    • should revert if the applicationId does not exist.
    • should only be callable by accounts with the ADMIN_ROLE
  • getApplication
    • should accept applicationId (uint256) as an input.
    • should return the name (string) and account (address) of the Application struct with the provided applicationId.
    • should revert if the applicationId does not exist
    • should be callable by any account
  • getApplications
    • should accept start (uint256) and limit (uint256) as inputs.
    • should return an array of Application structs starting from the start index and containing up to limit entries.
    • should return fewer than limit entries if there are not enough applications.
    • should be callable by any account.
@cyri113 cyri113 added this to the Application Manager milestone Jul 19, 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

No branches or pull requests

1 participant