Open code423n4 opened 2 years ago
@LilYeti : Confirm for HintHelpers. This issue does not apply to other contracts other than hinthelpers, since we need the other addresses to set them. No other contract takes hinthelpers though, so this could be used in the constructor technically.
Handle
WatchPug
Vulnerability details
https://github.com/code-423n4/2021-12-yetifinance/blob/5f5bf61209b722ba568623d8446111b1ea5cb61c/packages/contracts/contracts/HintHelpers.sol#L31-L52
Across the codebase, including in
HintHelpers.sol
,setAddresses()
is being used as a initializer function, it's aonlyOwner
function and it will_renounceOwnership()
at the end of the function.There are no other
onlyOwner
functions, the addresses set in the function are immutable after being set.Therefore,
setAddresses()
can be replaced withconstructor
and all the addresses can be declared asimmutable
variables instead ofstorage
variables.And
Ownable
can be removed to further reduce gas costs.This issue also applies to:
ActivePool.sol
BorrowerOperations.sol
CollSurplusPool.sol
DefaultPool.sol
PriceFeed.sol
StabilityPool.sol
TroveManager.sol
TroveManagerLiquidations.sol
TroveManagerRedemptions.sol
Whitelist.sol