Closed code423n4 closed 2 years ago
Meta0xNull
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.
https://github.com/maple-labs/maple-proxy-factory/blob/main/contracts/MapleProxyFactory.sol#L33 https://github.com/maple-labs/maple-proxy-factory/blob/main/contracts/MapleProxyFactory.sol#L42
Manual Review
Shorten the revert strings to fit in 32 bytes.
Or consider using Custom Errors (solc >=0.8.4).
Duplicate https://github.com/code-423n4/2021-12-maple-findings/issues/3
A duplicate of #3
Handle
Meta0xNull
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
https://github.com/maple-labs/maple-proxy-factory/blob/main/contracts/MapleProxyFactory.sol#L33 https://github.com/maple-labs/maple-proxy-factory/blob/main/contracts/MapleProxyFactory.sol#L42
Tools Used
Manual Review
Recommended Mitigation Steps
Shorten the revert strings to fit in 32 bytes.
Or consider using Custom Errors (solc >=0.8.4).