TwentyOne

First Flight #29
Beginner FriendlyGameFiFoundrySolidity
100 EXP
View results
Submission Details
Severity: low
Valid

Outdated Solidity version

Summary

The solidity version 0.8.13 doesn't support block.prevrandao

Vulnerability Details In twentyOne::drawcard function

uint256 randomIndex = uint256(
keccak256(
abi.encodePacked(block.timestamp, msg.sender, block.prevrandao) //-->> It will throw an error
)
) % availableCards[player].length;

Impact

The compiler will throw an error

Tools Used

solidity complier
Manual review

Recommendations

Use newer versions of solidity
Eg: ^0.8.20

Updates

Lead Judging Commences

inallhonesty Lead Judge 11 months ago
Submission Judgement Published
Validated
Assigned finding tags:

`block.prevrandao` usage fails with pragmas below 0.8.18

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.