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

1 stars 0 forks source link

settleAuction() can reset auctionBonder #54

Closed code423n4 closed 2 years ago

code423n4 commented 3 years ago

Handle

gpersoon

Vulnerability details

Impact

The function settleAuction() doesn't reset auctionBonder to 0. Although this does not give any problems for the logic, the value is no longer relevant after the auction and can be set to 0. Setting to 0 saves a bit of gas and also prevents mistakes in future code updates.

Proof of Concept

https://github.com/code-423n4/2021-09-defiProtocol/blob/main/contracts/contracts/Auction.sol#L69 function settleAuction( .. ) public override { .. require(msg.sender == auctionBonder); .. auctionOngoing = false; hasBonded = false;

Tools Used

Recommended Mitigation Steps

Set auctionBonder to 0 at the end of the function settleAuction()

GalloDaSballo commented 2 years ago

Duplicate of #40