code-423n4 / 2022-06-badger-findings

0 stars 0 forks source link

QA Report #88

Open code423n4 opened 2 years ago

code423n4 commented 2 years ago

Use a more recent version of solidity

Using newer compiler versions and the optimizer give gas optimizations and also are more secure. Also, additional safety checks are available for free.

The advantages here are:

Low level inliner (>= 0.8.2): Cheaper runtime gas (especially relevant when the contract has small functions). Optimizer improvements in packed structs (>= 0.8.3) Custom errors (>= 0.8.4): cheaper deployment cost and runtime cost. Note: the runtime cost is only relevant when the revert condition is met. In short, replace revert strings by custom errors.

Consider upgrading pragma to at least 0.8.4:

Instances:

MyStrategy.sol:3:pragma solidity 0.6.12;