code-423n4 / 2021-09-defiprotocol-findings

1 stars 0 forks source link

Gas: Can save an sload in `changeLicenseFee` #228

Open code423n4 opened 3 years ago

code423n4 commented 3 years ago

Handle

cmichel

Vulnerability details

The if-branch of Basket.changeLicenseFee function ensures that pendingLicenseFee.licenseFee == newLicenseFee which means setting licenseFee = newLicenseFee is equivalent to licenseFee = pendingLicenseFee.licenseFee but the former saves an expensive storage load operation.

GalloDaSballo commented 2 years ago

Great little finding!