Open code423n4 opened 3 years ago
ye0lde
Gas savings and code clarity
PrizePool.sol: https://github.com/pooltogether/v4-core/blob/35b00f710db422a6193131b7dc2de5202dc4677c/contracts/prize-pool/PrizePool.sol#L383-L387
Visual Studio Code, Remix
Replace this https://github.com/pooltogether/v4-core/blob/35b00f710db422a6193131b7dc2de5202dc4677c/contracts/prize-pool/PrizePool.sol#L383-L387 with return (ticket == _controlledToken)
return (ticket == _controlledToken)
PR: https://github.com/pooltogether/v4-core/pull/227
The sponsor has used the improvement
Handle
ye0lde
Vulnerability details
Impact
Gas savings and code clarity
Proof of Concept
PrizePool.sol: https://github.com/pooltogether/v4-core/blob/35b00f710db422a6193131b7dc2de5202dc4677c/contracts/prize-pool/PrizePool.sol#L383-L387
Tools Used
Visual Studio Code, Remix
Recommended Mitigation Steps
Replace this https://github.com/pooltogether/v4-core/blob/35b00f710db422a6193131b7dc2de5202dc4677c/contracts/prize-pool/PrizePool.sol#L383-L387 with
return (ticket == _controlledToken)