firoorg / solidity-BigNumber

Full BigNumber library implementation for Solidity.
MIT License
92 stars 23 forks source link

randomness_length is used before being defined #2

Closed brainhub closed 4 years ago

brainhub commented 5 years ago

https://github.com/zcoinofficial/solidity-BigNumber/blob/5355ea7c6e942f613855c509ebd0d98afbe39ec7/contracts/MockBigNumber.sol#L81

81: uint offset = (0x20 - ((randomness_length%0x20)==0 ? 0x20 : (randomness_length%0x20))); 82: uint randomness_length = randomness_length_base + offset;

Unclear how to resolve this issue. Switching the lines will make the same problem apply to offset.

This doesn't compile with Solidity 0.5.0

riordant commented 4 years ago

Resolved in https://github.com/zcoinofficial/solidity-BigNumber/commit/2bddf04709f0e1ed649b37b5533264cef8c5cbfe