code-423n4 / 2021-12-yetifinance-findings

0 stars 0 forks source link

Long revert string reasons #161

Closed code423n4 closed 2 years ago

code423n4 commented 2 years ago

Handle

p4st13r4

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

Many require calls contain long revert strings, e.g: https://github.com/code-423n4/2021-12-yetifinance/blob/main/packages/contracts/contracts/ActivePool.sol#L225

Tools Used

Editor

kingyetifinance commented 2 years ago

Duplicate #66