Fix indentation

This commit is contained in:
Tobias Eidelpes 2022-01-15 11:16:22 +01:00
parent 18927d1632
commit 51e72037f1
2 changed files with 4 additions and 4 deletions

Binary file not shown.

View File

@ -174,10 +174,10 @@ In this challenge we were given some form of a gambling contract, which promises
\begin{minted}[frame=lines,framesep=2mm,bgcolor=LightGray,fontsize=\footnotesize,linenos,breaklines]{solidity}
function PRNG(address sender) private view returns(uint8){
// Totally "awesome" PRNG
//return uint8(keccak256(abi.encodePacked(sender, block.coinbase, now, big_secret)));
return uint8(uint(keccak256(abi.encodePacked(sender, block.coinbase, now, big_secret))));
}
// Totally "awesome" PRNG
//return uint8(keccak256(abi.encodePacked(sender, block.coinbase, now, big_secret)));
return uint8(uint(keccak256(abi.encodePacked(sender, block.coinbase, now, big_secret))));
}
\end{minted}
Since blockchain is a deterministic data structure, anyone can produce the outcome of the PRNG function, given that they know the parameters/seeds used to generate randomness. Let's take a look at the parameters used in generation of a number:
\begin{itemize}