Omniscia Powercity Audit
DefaultPool Code Style Findings
DefaultPool Code Style Findings
DPL-01C: Multiple Top-Level Declarations
Type | Severity | Location |
---|---|---|
Code Style | DefaultPool.sol:L12, L19, L30 |
Description:
The referenced file contains multiple top-level declarations that decrease the legibility of the codebase.
Example:
12interface IERC20 {13 function transfer(address recipient, uint256 amount) external returns (bool);14 function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);15 function balanceOf(address account) external view returns (uint256);16 function approve(address spender, uint256 amount) external returns (bool);17}18
19interface ACTIVEPOOL{20 function addPulseX(uint _amount) external returns (bool);21}22
23/*24 * The Default Pool holds the ETH and LUSD debt (but not LUSD tokens) from liquidations that have been redistributed25 * to active troves but not yet "applied", i.e. not yet recorded on a recipient active trove's struct.26 *27 * When a trove makes an operation that applies its pending ETH and LUSD debt, its pending ETH and LUSD debt is moved28 * from the Default Pool to the Active Pool.29 */30contract DefaultPool is Ownable, CheckContract, IDefaultPool {
Recommendation:
We advise all highlighted top-level declarations to be split into their respective code files, avoiding unnecessary imports as well as increasing the legibility of the codebase.
Alleviation (8bedd3b0df6387957e6b8f5d52507e776c1458b0):
The Powercity team evaluated this exhibit but has opted to acknowledge it in the current iteration of the codebase.
DPL-02C: Redundant Contract Member
Type | Severity | Location |
---|---|---|
Gas Optimization | DefaultPool.sol:L40 |
Description:
The original DefaultPool
contract of Liquity already tracks the active pool address via its activePoolAddress
member, however, a new activePoolContract
member was introduced by PowerCity redundantly.
Example:
36address public activePoolAddress;37IERC20 public pulseXAddress;38uint256 internal ETH; // deposited ETH tracker39uint256 internal LUSDDebt; // debt;40ACTIVEPOOL activePoolContract;
Recommendation:
We advise the original activePoolAddress
to be utilized and to be cast to the relevant interface
on a need-to basis.
Alleviation (8bedd3b0df6387957e6b8f5d52507e776c1458b0):
The Powercity team evaluated this exhibit but has opted to acknowledge it in the current iteration of the codebase.