Fix indentation
This commit is contained in:
parent
18927d1632
commit
51e72037f1
Binary file not shown.
@ -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}
|
\begin{minted}[frame=lines,framesep=2mm,bgcolor=LightGray,fontsize=\footnotesize,linenos,breaklines]{solidity}
|
||||||
function PRNG(address sender) private view returns(uint8){
|
function PRNG(address sender) private view returns(uint8){
|
||||||
// Totally "awesome" PRNG
|
// Totally "awesome" PRNG
|
||||||
//return uint8(keccak256(abi.encodePacked(sender, block.coinbase, now, big_secret)));
|
//return uint8(keccak256(abi.encodePacked(sender, block.coinbase, now, big_secret)));
|
||||||
return uint8(uint(keccak256(abi.encodePacked(sender, block.coinbase, now, big_secret))));
|
return uint8(uint(keccak256(abi.encodePacked(sender, block.coinbase, now, big_secret))));
|
||||||
}
|
}
|
||||||
\end{minted}
|
\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:
|
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}
|
\begin{itemize}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user