Bit forever peaceful

foxbit(1)
Published in
#puzzle
Words
115
Reading
1 min
Listen
Play
7y

1445646070_blob.jpg

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)));

}

}

Bit forever peaceful | Ecency