Loot Box


Exposed Methods

addPrize adds a price to the loot box

parameter nametypedetails
_prizenamestringname of the won prize
_prizeworthuintseeling price of a prize

addFunds the owner can add funds to the contract

viewFunds shows the current balance of the contract

setKeyPrice the owner sets the price of a key

getKeyPrice shows the price of a key

openBox this function gives a random reward to a player, each function call requires the price of a key

getWonPrize show the prize won by a certain address

parameter nametypedetails
_addraddressetherum address of the player

sellPrize enables the player to purchase

withdraw withdraw function for the owner

parameter nametypedetails
_amountuintthe amount to be withdrawn from the contract
Reviewed by Modex
Buy Contract Test Contract

Create an account or login to purchase this smart contract