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

Introduce Battle Action for new arena service #3089

Open
Atralupus opened this issue Dec 16, 2024 · 0 comments
Open

Introduce Battle Action for new arena service #3089

Atralupus opened this issue Dec 16, 2024 · 0 comments
Assignees

Comments

@Atralupus
Copy link
Member

Atralupus commented Dec 16, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Todo
Development

No branches or pull requests

1 participant