Skip to content

Introduce Battle Action for new arena service #3089

Closed
@Atralupus

Description

@Atralupus

From planetarium/ArenaService#19

The action will be a simplified version of the existing BattleArena, removing elements like ticket management, win/loss records, and score tracking. Instead, it will focus solely on executing battles and recording the results in the state.

Additionally, it should include a metadata argument to verify the intent of the battle request by various services.

Proposed Action Parameters

public Address myAvatarAddress;
public Address enemyAvatarAddress;
public string metadata;
  • metadata: Services requesting the battle will sign the desired data and send it as a hashed string to be recorded on the chain. This works similarly to a JWT.
  • Since only the hash will be stored, this approach seems secure, but a thorough review is needed to ensure it doesn't compromise blockchain security.

Proposed State Format

public class BattleLog : IState
{
    public Address Challenger;
    public Address Opponent;
    public string Metadata;
    public bool IsVictory;
}

This structure is expected to record battle results.

Each service (e.g., Planetarium's ArenaService, another service) should be able to store AccountAddress differently, ensuring flexibility and customization across services.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

  • Status

    Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions