Closed code423n4 closed 2 years ago
gzeon
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.
e.g. ./contracts/L1/gateway/L1Migrator.sol:508 ./contracts/L1/gateway/L1Migrator.sol:513 ./contracts/L2/gateway/L2Migrator.sol:136 ./contracts/L2/gateway/L2Migrator.sol:184 ./contracts/L2/gateway/L2Migrator.sol:201 ./contracts/L2/gateway/L2Migrator.sol:221 ./contracts/L2/gateway/L2Migrator.sol:257 ./contracts/L2/gateway/L2Migrator.sol:269 ./contracts/L2/gateway/L2Migrator.sol:274 ./contracts/L2/pool/DelegatorPool.sol:39 ./contracts/L2/pool/DelegatorPool.sol:61
Duplicate of https://github.com/code-423n4/2022-01-livepeer-findings/issues/115
Handle
gzeon
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
e.g. ./contracts/L1/gateway/L1Migrator.sol:508 ./contracts/L1/gateway/L1Migrator.sol:513 ./contracts/L2/gateway/L2Migrator.sol:136 ./contracts/L2/gateway/L2Migrator.sol:184 ./contracts/L2/gateway/L2Migrator.sol:201 ./contracts/L2/gateway/L2Migrator.sol:221 ./contracts/L2/gateway/L2Migrator.sol:257 ./contracts/L2/gateway/L2Migrator.sol:269 ./contracts/L2/gateway/L2Migrator.sol:274 ./contracts/L2/pool/DelegatorPool.sol:39 ./contracts/L2/pool/DelegatorPool.sol:61