Open code423n4 opened 3 years ago
WatchPug
https://github.com/code-423n4/2021-09-defiProtocol/blob/main/contracts/contracts/Auction.sol#L47-L52
Auction.sol#initialize() is using the factory_ parameter as the value of factory, while Basket.sol#initialize() uses msg.sender.
Auction.sol#initialize()
factory
Basket.sol#initialize()
msg.sender
https://github.com/code-423n4/2021-09-defiProtocol/blob/main/contracts/contracts/Basket.sol#L39
Consider changing to msg.sender and remove the factory_ parameter for the purpose of consistency and gas saving.
factory_
Finding is valid, savings are minor
Handle
WatchPug
Vulnerability details
https://github.com/code-423n4/2021-09-defiProtocol/blob/main/contracts/contracts/Auction.sol#L47-L52
Auction.sol#initialize()
is using the factory_ parameter as the value offactory
, whileBasket.sol#initialize()
usesmsg.sender
.https://github.com/code-423n4/2021-09-defiProtocol/blob/main/contracts/contracts/Basket.sol#L39
Consider changing to
msg.sender
and remove thefactory_
parameter for the purpose of consistency and gas saving.