bosonprotocol / contracts

[DEPRECATED] Boson Protocol v1
GNU Lesser General Public License v3.0
69 stars 17 forks source link

Read Access Optimization #328

Closed zajck closed 2 years ago

zajck commented 2 years ago

DAI-01C: Read Access Optimization

Type Severity Location
Gas Optimization Informational DAITokenWrapper.sol:L24

Description:

The owner invocation will redundantly read the value of msg.sender from storage as it is performed in the constructor of the contract.

Example:

constructor(
    address _daiTokenAddress
) 
notZeroAddress(_daiTokenAddress)
{
    daiTokenAddress = _daiTokenAddress;
    emit LogTokenAddressChanged(_daiTokenAddress, owner());
}

Recommendation:

We advise the msg.sender value to be used directly, optimizing the codebase.