code-423n4 / 2022-04-badger-citadel-findings

0 stars 1 forks source link

Gas Optimizations #204

Open code423n4 opened 2 years ago

code423n4 commented 2 years ago

Citadelminer.sol:

    fundingPoolWeights[_pool] = 0;

Should be Uninitialized should be used and make it less gas with same result

Line 370 string require more then 32 bytes takes up more gas Funding.sol minCitadelPriceInAsset Variable never used so just leave it uninitialized Line 148 require string more then 32 bytes make shorter to save gas. Line 170 Require statement require says not zero so to save gas != 0 or change there require statement has to be Greater then 0 Line 424 same thing as above KnightingRound.sol Function initialize
Gas save with the non zero by != To save gas also the string have to be less then 32 bytes or cost more gas Lines:124,128,313 Stakedcitadel.sol uint256 constant ONE_ETH = 1e18; should be 10** 18 tp save gas StakedcitadelVestor.sol Line:138 require says not vest zero save gas != Supplyshed.sol Line:96 to big string

Line 143 string to big