code-423n4 / 2021-04-marginswap-findings

1 stars 0 forks source link

[Gas] unused variables #56

Open code423n4 opened 3 years ago

code423n4 commented 3 years ago

Email address

pauliax6@gmail.com

Handle

paulius.eth

Eth address

0x523B5b2Cc58A818667C22c862930B141f85d49DD

Vulnerability details

Gas optimization suggestion:

Contract RoleAware has a role that is not used anywhere: uint256 constant TOKEN_ADMIN = 109; contract IsolatedMarginTrading has variables that are not used anywhere:

/// update window in blocks uint16 public priceUpdateWindow = 8; uint256 public UPDATE_RATE_PERMIL = 80; Variables with the same name are declared and used in contract PriceAware.

Contract IsolatedMarginAccounts has a variable that is not used anywhere: coolingOffPeriod. Variable with the same name is used in CrossMarginTrading.

Another not used variable: uint256 public borrowingMarkupFP;

werg commented 3 years ago

TOKEN_ADMIN is used in other parts of the codebase related to initialization, not presented here.