Closed code423n4 closed 2 years ago
GiveMeTestEther
Shortening revert strings to fit in 32 bytes will decrease deployment time gas and will decrease runtime gas when the revert condition has been met.
Revert strings that are longer than 32 bytes require at least one additional mstore, along with additional overhead for computing memory offset, etc.
2021-12-pooltogether\TwabRewards.sol: require(_to != address(0), "TwabRewards/recipient-not-zero-address"); length: 38 2021-12-pooltogether\TwabRewards.sol: require(_ticket != address(0), "TwabRewards/ticket-not-zero-address"); length: 35
Manual Analysis
Duplicate of https://github.com/code-423n4/2021-12-pooltogether-findings/issues/13
Handle
GiveMeTestEther
Vulnerability details
Impact
Shortening revert strings to fit in 32 bytes will decrease deployment time gas and will decrease runtime gas when the revert condition has been met.
Revert strings that are longer than 32 bytes require at least one additional mstore, along with additional overhead for computing memory offset, etc.
Proof of Concept
2021-12-pooltogether\TwabRewards.sol: require(_to != address(0), "TwabRewards/recipient-not-zero-address"); length: 38 2021-12-pooltogether\TwabRewards.sol: require(_ticket != address(0), "TwabRewards/ticket-not-zero-address"); length: 35
Tools Used
Manual Analysis
Recommended Mitigation Steps