You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
Application Manager
CRUD contract for applications.
Requirements
Application
struct with the following fields:name
(string)account
(address)external
functioncreateApplication
external
functionupdateApplication
external
functiondeleteApplication
external
functiongetApplication
external
functiongetApplications
CreateApplication
UpdateApplication
DeleteApplication
accessManager_
as a AccessManagerapplications
fromuint256
(application IDs) toApplication
structs.uint256
variablenextApplicationId
to track the next application ID.name
(string) andaccount
(address) as inputs.nextApplicationId
.Application
struct with the providedname
andaccount
and store it in theapplications
mapping with the key as the newapplicationId
.ApplicationCreated
event with the new application's details.ADMIN_ROLE
.applicationId
(uint256),name
(string), andaccount
(address) as inputs.Application
struct in theapplications
mapping with the providedapplicationId
to have the newname
andaccount
.ApplicationUpdated
event with the updated application's details.applicationId
does not exist.ADMIN_ROLE
.applicationId
(uint256) as an input.Application
struct from theapplications
mapping with the providedapplicationId
.ApplicationDeleted
event with the deleted application's ID.applicationId
does not exist.ADMIN_ROLE
applicationId
(uint256) as an input.name
(string) andaccount
(address) of theApplication
struct with the providedapplicationId
.applicationId
does not existThe text was updated successfully, but these errors were encountered: