Omniscia Powercity Audit
BorrowerOperations Code Style Findings
BorrowerOperations Code Style Findings
BOS-01C: Incorrect Token Approvals
Type | Severity | Location |
---|---|---|
Gas Optimization | BorrowerOperations.sol:L375-L376, L467-L468 |
Description:
The referenced pairs of ERC20::approve
and ActivePool::sendETH
invocations are incorrect as the ActivePool::sendETH
function will attempt to distribute from its own PulseX balance rather than the balance of the BorrowerOperations
contract.
Example:
467pulseXToken.approve(address(_activePool), _collChange); //Shinto: Approve PLSX to active pool468_activePool.sendETH(_borrower, _collChange);
Recommendation:
We advise the incorrect approvals to be safely omitted, optimizing the code's gas cost.
Alleviation (8bedd3b0df):
The redundant approval operations remain in the codebase, rendering this exhibit acknowledged.
Alleviation (e1d571bb78):
The redundant EIP-20 approve
operations have been safely omitted as advised.
BOS-02C: Unutilized Contract Member
Type | Severity | Location |
---|---|---|
Gas Optimization | BorrowerOperations.sol:L39 |
Description:
The pulseX
contract member of the BorrowerOperations
contract remains unutilized throughout the contract.
Example:
31IPulseX public pulseXToken;32address public lqtyStakingAddress;33
34ILUSDToken public lusdToken;35
36// A doubly linked list of Troves, sorted by their collateral ratios37ISortedTroves public sortedTroves;38
39IPulseX public pulseX;
Recommendation:
We advise it to be safely omitted, optimizing the contract's deployment gas cost.
Alleviation (8bedd3b0df):
The redundant contract-level variable remains in the codebase, rendering this exhibit acknowledged.
Alleviation (e1d571bb78):
The pulseX
member of the contract has been safely omitted, optimizing its bytecode size.