code-423n4 / 2022-07-swivel-findings

0 stars 1 forks source link

Gas Optimizations #4

Closed code423n4 closed 2 years ago

code423n4 commented 2 years ago

Use custom errors rather than revert()/require() strings to save gas

File: 2022-07-swivel\2022-07-swivel\Creator\LibCompound.sol 28,9: require(borrowRateMantissa <= 0.0005e16, "RATE_TOO_HIGH"); // Same as borrowRateMaxMantissa in CTokenInterfaces.sol

File: 2022-07-swivel\2022-07-swivel\Creator\LibFuse.sol 36,13: require(borrowRateMantissa <= 0.0005e16, "RATE_TOO_HIGH");

File: 2022-07-swivel\2022-07-swivel\Tokens\LibCompound.sol 28,9: require(borrowRateMantissa <= 0.0005e16, "RATE_TOO_HIGH"); // Same as borrowRateMaxMantissa in CTokenInterfaces.sol

File: 2022-07-swivel\2022-07-swivel\Tokens\LibFuse.sol 36,13: require(borrowRateMantissa <= 0.0005e16, "RATE_TOO_HIGH");

File: 2022-07-swivel\2022-07-swivel\VaultTracker\LibCompound.sol 28,9: require(borrowRateMantissa <= 0.0005e16, "RATE_TOO_HIGH"); // Same as borrowRateMaxMantissa in CTokenInterfaces.sol

File: 2022-07-swivel\2022-07-swivel\VaultTracker\LibFuse.sol 36,13: require(borrowRateMantissa <= 0.0005e16, "RATE_TOO_HIGH");

JeeberC4 commented 2 years ago

Warden submitted multiple Gas Optimizations. Will not be judged.