code-423n4 / 2022-05-factorydao-findings

1 stars 1 forks source link

Gas Optimizations #276

Open code423n4 opened 2 years ago

code423n4 commented 2 years ago

Declare variables immutable

The _name, _symbol, and _minter state variables in VoterID are set in the constructor and do not change. They can be declared immutable.

VoterID.sol#L65-L66

    string _name;
    string _symbol;

VoterID.sol#L73-L74

 // minter has the sole, permanent authority to mint identities, in practice this will be a contract
    address public _minter;

Suggestion:

    string immutable _name;
    string immutable _symbol;
 // minter has the sole, permanent authority to mint identities, in practice this will be a contract
    address immutable public _minter;
illuzen commented 2 years ago

all duplicates