3.1 Competition

The base Competition contract is an interface for tracking competition progression and results. It serves as the foundation for the other two competition types, enabling organizers to create and manage events with ease.

Function 1: start

function start() public onlyOwner whenNotLive whenNotExpired

This function starts the competition.

NameTypeDescription

(no params)

Function 2: setTeamNames

function setTeamNames(string[] calldata _names) public onlyOwner whenNotLive

This function sets the team names in the competition.

NameTypeDescription

_names

string[] calldata

Array of team names.

Function 3: completeMatch

function completeMatch(uint256 _matchId, uint8 _winningTeamId) external onlyOwner whenInProgress

This function completes a match and records the winning team.

NameTypeDescription

_matchId

uint256

The ID of the match.

_winningTeamId

uint8

The ID of the winning team.

Function 4: advanceRound

function advanceRound(uint8[] calldata _matchResults) public onlyOwner whenInProgress

This function advances the competition to the next round using the provided match results.

NameTypeDescription

_matchResults

uint8[] calldata

Array of winning team IDs.

Function 5: advanceRound

function advanceRound() public onlyOwner whenInProgress

This function advances the competition to the next round, assuming all matches are completed.

NameTypeDescription

(no params)

Function 6: getCompetitionProgression

function getCompetitionProgression() public view returns(MatchOutcome[] memory bracketProgress_)

This function returns the competition's bracket progression.

NameTypeDescription

bracketProgress_

MatchOutcome[] memory

Array of match outcomes.

Function 7: getMatchOutcome

function getMatchOutcome(uint256 _matchId) external view returns(MatchOutcome memory matchOutcome_)

This function returns the outcome of a specific match.

NameTypeDescription

_matchId

uint256

The ID of the match.

matchOutcome_

MatchOutcome memory

The match outcome.

Last updated