diff --git a/project2/report2.pdf b/project2/report2.pdf index 081a5a4..2e60752 100644 Binary files a/project2/report2.pdf and b/project2/report2.pdf differ diff --git a/project2/report2.tex b/project2/report2.tex index 2d590fe..bb8b6d8 100644 --- a/project2/report2.tex +++ b/project2/report2.tex @@ -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}