Skip to content

Commit

Permalink
Complete tournament module + tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ismellike committed Jun 5, 2024
1 parent 87d737a commit 9408e3a
Show file tree
Hide file tree
Showing 5 changed files with 614 additions and 237 deletions.
34 changes: 22 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,27 +16,37 @@ The project is organized into several directories:

- `packages`: This directory contains Rust packages that are used by the contracts. Each package has a Cargo.toml file and a src directory.

- `scripts`: This directory contains batch files for checking and optimizing the contracts.
- `scripts`: This directory contains the justfile and `cw-orch` scripts and tests.


## Building and Testing
## Scripts

The `scripts/check` file is used to check for unused dependencies, format the code, and run clippy for linting. It uses the nightly version of cargo for these tasks.
This project uses `just` as a command runner to simplify common tasks. Below are the available scripts:

The `scripts/gen` file is used to generate the contract schemas and TypeScript types. It first generates the schemas for all contracts and then generates the TypeScript types.
### `check`
Runs formatting and linting checks to ensure code quality:

The `scripts/optimize` file is used to optimize the smart contracts. It uses the Docker image `cosmwasm/workspace-optimizer:0.15.1` to run the optimization process.
- **Format check**: Ensures the code formatting adheres to the standard Rust format using `cargo fmt`.
- **Lint check**: Runs `clippy` to catch common mistakes and improve your Rust code.

The GitHub Actions workflows in the `.github/workflows` directory are used to run tests and lints on every push and pull request.
### `download-deps`

## Smart Contracts
Downloads necessary wasm artifacts for the project:

The smart contracts are written in Rust and use the CosmWasm framework. Each contract has its own directory under the `contracts` directory. The `Cargo.toml` file in each contract directory specifies the contract's dependencies.
Downloads various wasm modules like cw20_base, cw4_group, cw721_base, from the CosmWasm repository and dao_contracts from the DAO-DAO repository into the artifacts directory.

## Continuous Integration
### `udeps`

Finds unused dependencies in the project using cargo udeps. This helps in identifying unnecessary dependencies that can be removed to streamline the project.

### `optimize`

The project uses GitHub Actions for continuous integration. The workflows are defined in the `.github/workflows` directory. The `basic.yml` workflow runs tests and lints on every push and pull request.
Optimizes the wasm builds using Docker and the CosmWasm optimizer.

## Architecture Diagram
### `schema`

Generates JSON schema for messages used in the smart contracts.

## Continuous Integration

![image](https://showme.redstarplugin.com/d/d:LvtiZJV2)
The project uses GitHub Actions for continuous integration. The workflows are defined in the `.github/workflows` directory. The `basic.yml` workflow runs tests and lints on every push and pull request.
22 changes: 14 additions & 8 deletions contracts/arena-tournament-module/README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
# Arena-League-Module
# Arena Tournament Module

Arena-League-Module is a competition module for the Arena Protocol. It provides functionality for creating, managing, and participating in leagues. This contract is designed to work in conjunction with the Arena-Core contract.
## Overview

## Key Features
The Arena Tournament Module is a robust and flexible solution designed for managing competitive gaming tournaments within the blockchain ecosystem. This module supports both single-elimination and double-elimination tournament formats, providing organizers with powerful tools to create, manage, and execute tournaments effectively.

- Creation of new leagues: Leagues can be created with a set of teams and a round duration.
- Management of league participants: The contract handles the management of league participants, including their points and matches played.
- Handling of league competition results: The contract processes match results and updates the league standings accordingly.
- Round-Robin Tournament Format: Leagues use a round-robin format for tournaments, ensuring each team plays every other team.
- Querying for league information and participant standings: The contract provides queries for retrieving league information, such as the leaderboard and details of a specific round.
## Features

### Tournament Types

- **Single-Elimination Tournaments**: Competitors are eliminated after a single loss. The module supports an optional third-place match, allowing organizers to decide whether to have a consolation game.

- **Double-Elimination Tournaments**: Competitors have the opportunity to lose twice before being eliminated. This format involves a winners' bracket and a losers' bracket, ensuring a fair chance for all participants and exciting comebacks.

### Seeding

- **Automatic Seeding**: The module automatically seeds teams based on the order of addresses provided at the initiation of the tournament. Addresses listed earlier are given higher seeding, influencing their initial matchups and positions in the bracket. This seeding method ensures a strategic starting layout, enhancing competitive balance.
Loading

0 comments on commit 9408e3a

Please sign in to comment.