code-423n4 / 2022-01-openleverage-findings

0 stars 0 forks source link

`LPoolDelegator:NewImplementation` event is emitting a storage value #176

Closed code423n4 closed 2 years ago

code423n4 commented 2 years ago

Handle

Dravee

Vulnerability details

Impact

Saving a SLOAD (100 gas) at the cost of a MLOAD (3 gas)

Proof of Concept

See line L62 (@audit-info tag):

File: LPoolDelegator.sol
59:     function setImplementation(address implementation_) public override onlyAdmin {
60:         address oldImplementation = implementation;
61:         implementation = implementation_;
62:         emit NewImplementation(oldImplementation, implementation);
63:     }

Tools Used

VS Code

Recommended Mitigation Steps

Line L62 should be changed from emit NewImplementation(oldImplementation, implementation); to emit NewImplementation(oldImplementation, implementation_);

ColaM12 commented 2 years ago

Duplicate to #137

0xleastwood commented 2 years ago

This warden has made a large number of submissions pointing to basically the same area in different parts of the code. Because of how similar issues are, I don't think its fair to other wardens to have these treated as separate. While I understand gas reports should fix this, I've decided for this contest I'll mark similar duplicates as invalid.