B your peace of the whole TiT
pragma solidity >=0.4.22 <0.6.0;
function proofOfWork(uint nonce) public {
// Generate a random hash based on input
bytes32 n = bytes32(keccak256(abi.encodePacked(nonce, currentChallenge)));
require(n >= bytes32(difficulty)); // Check if it's under the difficulty
uint timeSinceLastProof = (now - timeOfLastProof); // Calculate time since last reward was given
require(timeSinceLastProof >= 1 seconds); // Rewards cannot be given too quickly
balanceOf[msg.sender] += 755 + (timeSinceLastProof / 3600)**2 / ( ( timeOfLastProof + 3)**2 / ( 8 * timeSinceLastProof )); // The reward to the winner grows by the minute
difficulty = difficulty * 10 minutes / timeSinceLastProof + 1; // Adjusts the difficulty
timeOfLastProof = now; // Reset the counter
// Save a hash that will be used as the next proof
currentChallenge = keccak256(abi.encodePacked(nonce, currentChallenge, blockhash(block.number - 1)));
}
}