Skip to content

Implement group creation function with validation #58

Description

@Akshola00

Description

Implement the create function to create new payroll groups with proper validation and event emission.

Add implementation in src/lib.rs.

Relevant files:

  • contract/src/lib.rs

Acceptance Criteria

  • Function accepts: creator (Address), token (Symbol), name (Symbol)
  • Function validates creator is not zero address
  • Function generates unique group ID
  • Function stores group in contract state
  • Function emits GroupCreated event
  • Function returns the new group ID
  • Rejects invalid inputs with proper error types
  • Relevant contract tests are written
  • All contract tests pass
  • Contract code builds successfully
  • Contract code is properly formatted

Dependencies

C-1 (Error types), C-2 (Data types), C-3 (Events), C-4 (Trait interface)

Additional Notes

  • Group ID can be sequential number or hash-based
  • Store in a contract data map for efficient lookup
  • Consider gas costs for storage

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

GrantFox OSSIssue tracked in GrantFox OSSMaybe RewardedIssue may be eligible for a GrantFox rewardThird CampaignCampaign: Third CampaigncontractSmart Contract (Soroban/Rust)entry-levelEntry-level difficultyfunctionsFunction implementation

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions