Omniscia Tokemak Network Audit

DelegateFunction Code Style Findings

DelegateFunction Code Style Findings

DFN-01C: Inefficient Hash Specification

TypeSeverityLocation
Gas OptimizationInformationalDelegateFunction.sol:L28, L33, L38, L41, L50, L51

Description:

The linked variable is assigned to a keccak256 instruction and is declared as constant.

Example:

contracts/delegation/DelegateFunction.sol
28bytes32 public constant EIP712_DOMAIN_TYPEHASH =
29 keccak256(
30 "EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)"
31 );

Recommendation:

We advise it to be set as immutable instead to cache the result of the keccak256 instruction as otherwise it is performed each time redundantly.

Alleviation:

All linked variables were properly set to immutable from constant to take advantage of the gas optimization.