Omniscia Bluejay Finance Audit
TreasuryBondDepository Code Style Findings
TreasuryBondDepository Code Style Findings
TBD-01C: Inexistent Visibility Specifiers
Type | Severity | Location |
---|---|---|
Code Style | ![]() | TreasuryBondDepository.sol:L22-L24 |
Description:
The linked variables have no visibility specifiers explicitly set.
Example:
22uint256 constant WAD = 10**18;23uint256 constant RAY = 10**27;24uint256 constant RAD = 10**45;
Recommendation:
We advise them to be set to avoid potential compilation discrepancies in the future as the current behaviour is for the compiler to assign one automatically which may deviate between pragma
versions.
Alleviation:
The private
visibility specifier has been introduced for the referenced variable alleviating this exhibit.
TBD-02C: Redundant Duplicate Transfer
Type | Severity | Location |
---|---|---|
Gas Optimization | ![]() | TreasuryBondDepository.sol:L89, L90 |
Description:
The linked safeTransferFrom
and safeTransfer
invocations are redundant as the safeTransferFrom
function can directly transmit funds to the treasury
.
Example:
89reserve.safeTransferFrom(msg.sender, address(this), amount);90reserve.safeTransfer(address(treasury), amount);
Recommendation:
We advise this to be done so to optimize the gas cost of the function. Likewise, the fee acquired can be minted directly to the feeCollector
instead of being transferred afterwards.
Alleviation:
The redundant iterative transfers have been replaced by a single safeTransferFrom
operation as advised.