Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

uint256(-1) #3

Open
code423n4 opened this issue Jun 20, 2021 · 0 comments
Open

uint256(-1) #3

code423n4 opened this issue Jun 20, 2021 · 0 comments
Labels

Comments

@code423n4
Copy link
Contributor

Handle

gpersoon

Vulnerability details

Impact

uint256(-1) is used in the function initialize of PrizePool.sol to indicate the max uint256 value. Solidity also allows type(uint256).max), which is easier to read.

Proof of Concept

// https://github.com/code-423n4/2021-06-pooltogether/blob/main/contracts/PrizePool.sol#L233
function initialize (
...
_setLiquidityCap(uint256(-1));

Tools Used

Recommended Mitigation Steps

Replace uint256(-1) with:
type(uint256).max)

@code423n4 code423n4 added bug Something isn't working 0 (Non-critical) labels Jun 20, 2021
code423n4 added a commit that referenced this issue Jun 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants