Omniscia DAFI Protocol Audit
PriceFeed Code Style Findings
PriceFeed Code Style Findings
PFD-01C: Redundant Code
Type | Severity | Location |
---|---|---|
Gas Optimization | Informational | PriceFeed.sol:L13-L16, L30, L71-L76 |
Description:
The dLINK
, dBTC
, dETH
and dAAVE
variables are assigned to only once during the constructor
's execution and are done so to value literals as computed by stringToBytes32
.
Example:
contracts/PriceFeed.sol
71function setBytes32Code() internal{72 dLINK = stringToBytes32("dLINK");73 dBTC = stringToBytes32("dBTC");74 dETH = stringToBytes32("dETH");75 dAAVE = stringToBytes32("dAAVE");76}
Recommendation:
We advise these values to be computed offchain and directly set at their assignment, enabling the variables to be set as constant
and greatly optimizing the codebase.The development team has acknowledged this exhibit but decided to not apply its remediation in the current version of the codebase citing time constraints.
Alleviation:
The development team has acknowledged this exhibit but decided to not apply its remediation in the current version of the codebase citing time constraints.