Closed zajck closed 2 years ago
The owner invocations will redundantly read the value of msg.sender from storage as they are performed in the constructor of the contract.
owner
msg.sender
constructor
/** * @notice Constructor * @param _bosonRouterAddress - address of the associated BosonRouter contract instance * @param _conditionalToken - address of the conditional token * @param _conditionalTokenType - the type of the conditional token */ constructor( address _bosonRouterAddress, address _conditionalToken, TokenType _conditionalTokenType ) notZeroAddress(_conditionalToken) notZeroAddress(_bosonRouterAddress) { bosonRouterAddress = _bosonRouterAddress; conditionalTokenContract = _conditionalToken; conditionalTokenType = _conditionalTokenType; emit LogBosonRouterSet(_bosonRouterAddress, owner()); emit LogConditionalContractSet(_conditionalToken, _conditionalTokenType, owner()); }
We advise the msg.sender value to be used directly, optimizing the codebase.
GAT-01C: Read Access Optimizations
Description:
The
owner
invocations will redundantly read the value ofmsg.sender
from storage as they are performed in theconstructor
of the contract.Example:
Recommendation:
We advise the
msg.sender
value to be used directly, optimizing the codebase.