Skip to content
The first game for blockchain, see https://wofgame.github.io
Branch: master
Clone or download
Latest commit 24cb9ec Apr 23, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
128px-Blizzard_Entertainment_Logo.svg.png Add files via upload Apr 23, 2019
README.md Update README.md Apr 23, 2019

README.md

blizzardgame

wofgame

The first game for blockchain, see https://wofgame.github.io

Rule analysis

  • 25% dynamic within 3 generations
  • 12% weight distribution
  • 15% prize pool
  • >= 40% static + dynamic precipitation + weight dividend precipitation + ticket income
  • 3% platform fee
  • 5% Team node distribution
uint256 public gdy_ = 25;
uint256 public gstatic_ = 40;
uint256 public gbpool_ = 15;
uint256 gfee = 3;
uint256 gangle = 5;
uint256 gteam = 12

Source code analysis

Floating income calculation

function rand(uint256 _length, address _pAddress) 
        private
        view
        returns(uint256) 
{
	uint256 random = uint256(keccak256(abi.encodePacked(block.difficulty, now, _pAddress, inc_)));
	return random%_length;
}

function inc()
	private
        view
        returns(uint256) 
{
	return rand(100, _pAddress) < 50 ? inc_+=3 : inc+=5;
}
  • Random number generation
  • Random seed acquisition

Static income calculation

function calc(address _pAddress, uint256 _canIncome, uint256 _day, uint256 _probFixResW)
        private
        view
        returns(uint256)
{
        uint256 _teth = plyr_[_pAddress].curjoin;
        uint256 _rndrate;
        if(_probFixResW != 0)
            _rndrate = _probFixResW;
        else 
            _rndrate = getFixRetWRand(_pAddress);
        uint256 _income = _teth.mul(_rndrate).mul(_day).div(10000);
        return _canIncome < _income ? _canIncome : _income;
}
  • Calculate the expected return and the actual earned income based on the current latest participation, number of days, and income that can be received

Win the prize in the small prize pool

function getWinRecord(address _addr)
        view
        public
        returns(uint256[],uint256[],uint256[],uint256[],uint256[],uint256[])
{
	uint256[] memory r1 = new uint256[](2);
	uint256[] memory r2 = new uint256[](2);
	uint256[] memory r3 = new uint256[](2);
	uint256[] memory r241 = new uint256[](2);
	uint256[] memory r242 = new uint256[](2);
	uint256[] memory r243 = new uint256[](2);
	if(rID_ > 1){
		r1[0] = rID_ - 1;
		r1[1] = plyrRnds_[_addr][r1[0]].win;
	}
	if(rID_ > 2){
		r2[0] = rID_ - 2;
		r2[1] = plyrRnds_[_addr][r2[0]].win;
	}
	if(rID_ > 3){
		
		r3[0] = rID_ - 3;
		r3[1] = plyrRnds_[_addr][r3[0]].win;
	}
	if(r24ID_ > 1){
		r241[0] = r24ID_ - 1;
		r241[1] = plyrRnds24_[_addr][r241[0]].win;
	}

	if(r24ID_ > 2){
		
		r242[0] = r24ID_ - 2;
		r242[1] = plyrRnds24_[_addr][r242[0]].win;
	}
	if(r24ID_ > 3){
		
		r243[0] = r24ID_ - 3;
		r243[1] = plyrRnds24_[_addr][r243[0]].win;
	}
	return(r1, r2, r3, r241, r242, r243);
}
You can’t perform that action at this time.