Skip to content

CONTRACT: Player Registry Contract #26

@PoulavBhowmick03

Description

@PoulavBhowmick03

Title: On-Chain Player Metadata Management
Description
Create contract to store player profiles with IPFS metadata.

Acceptance Criteria:

  • Stores player attributes:
    • Position
    • Base salary
    • Metadata CID
  • Allows admin updates
  • Emits PlayerUpdated events

Technical Details:

#[starknet::contract]
mod PlayerRegistry {
    #[storage]
    struct Storage {
        players: LegacyMap<felt252, Player>,
        admin: felt252
    }

    #[derive(Drop, Serde)]
    struct Player {
        position: u8,
        base_salary: u64,
        metadata_cid: felt252
    }

    #[external(v0)]
    fn register_player(
        ref self: ContractState,
        id: felt252,
        position: u8,
        salary: u64,
        cid: felt252
    ) {
        assert(get_caller_address() == self.admin.read(), 'Unauthorized');
        self.players.write(id, Player { position, base_salary: salary, metadata_cid });
    }
}

Notes:

  • Add versioning for metadata updates
  • Implement batch registration
  • Add salary cap validation

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions