November 2018
Intermediate to advanced
528 pages
13h 21m
English
In order to start the game, a player has to call the join() method while sending more than one ether to the Tontine contract. Therefore, in the Ctontine contract, we need to implement this function as follows:
function join() public payable returns(bool) { require(Tplayer.exist(msg.sender), "player doesn't exist"); require(msg.value >= 1 ether && Tpension[msg.sender] == 0, "send higher pension"); Tpension[msg.sender] = msg.value; Tplayer.EditPlayer(msg.sender, active_players.length); active_players.push(Tplayer.getplayer(msg.sender)); Lindex += (active_players.length - 1); ping_time[msg.sender] = now; emit NewActivePlayerEv(msg.sender, now); return true;}Let’s go over this implementation, line by line.
First of all, the ...
Read now
Unlock full access