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

1 stars 0 forks source link

Gas: Can save an sload in `changePublisher` #227

Open code423n4 opened 2 years ago

code423n4 commented 2 years ago

Handle

cmichel

Vulnerability details

The if-branch of Basket.changePublisher function ensures that pendingPublisher.publisher == newPublisher which means setting publisher = newPublisher is equivalent to publisher = pendingPublisher.publisher but the former saves an expensive storage load operation.

GalloDaSballo commented 2 years ago

Valid finding