Football Betting

FINANCIALUTILITYTOOLS

Exposed methods

addPlayer adds a player's bet, choice and a nickname

parameter nametypedetails
_nicknamestringnickname of the player
_choiceuintthe choice made by the player

addTeam adds a team to the array

parameter nametypedetails
_namestringname of the team

setConditions allows the owner of the contract to set a minimum wage

parameter nametypedetails
_minwageuintset by the owner to put the mimum wage

matchStarted owner only function to end the bets when the match started

outcomeMatch this function is used to store the outcome of the match

parameter nametypedetails
_outcomestringthe owner writes the outcome of the match to be displayed
_outcomenumberuintthe owner writes the outcome of the match to be displayed
_indexteamsuintindex used to keep track of the teams

payWinner pays the winner if checkwinner returns true with an amount set by the dapp

withdraw allows the owner to get his earnings if the winners of the bet got their winnings

checkwinner upon entering an address, the function will check if it one of the former winners or not

parameter nametypedetails
_nicknamestringnickname of the player

Events

Winnercheck event that shows the nickname of the winner MatchOutcome shows the outcome of the match WinnerPayment logs the payment of the winner newPlayer stores information regarding the added players

Buy
Reviewed by Modex
Buy Contract Test Contract

Create an account or login to purchase this smart contract