Omniscia Powercity Audit

ActivePool Static Analysis Findings

ActivePool Static Analysis Findings

APL-01S: Inexistent Sanitization of Input Address

TypeSeverityLocation
Input SanitizationActivePool.sol:L61

Description:

The linked function accepts an address argument yet does not properly sanitize it.

Impact:

The presence of zero-value addresses, especially in constructor implementations, can cause the contract to be permanently inoperable. These checks are advised as zero-value inputs are a common side-effect of off-chain software related bugs.

Example:

ActivePool.sol
56function setAddresses(
57 address _borrowerOperationsAddress,
58 address _troveManagerAddress,
59 address _stabilityPoolAddress,
60 address _defaultPoolAddress,
61 address _pulseX, //Shinto: setAddresses, parameter added
62 address _collSurplusPoolAddress
63)
64 external
65 onlyOwner
66{
67 checkContract(_borrowerOperationsAddress);
68 checkContract(_troveManagerAddress);
69 checkContract(_stabilityPoolAddress);
70 checkContract(_defaultPoolAddress);
71 checkContract(_collSurplusPoolAddress);

Recommendation:

We advise some basic sanitization to be put in place by ensuring that the address specified is non-zero.

Alleviation (8bedd3b0df6387957e6b8f5d52507e776c1458b0):

The _pulseX address is now properly sanitized in the ActivePool::setAddresses function by passing it in the CheckContract::checkContract modifier, alleviating this exhibit.

APL-02S: Improper Invocations of EIP-20 transfer / transferFrom

TypeSeverityLocation
Standard ConformityActivePool.sol:L123, L167

Description:

The linked statements do not properly validate the returned bool values of the EIP-20 standard transfer & transferFrom functions. As the standard dictates, callers must not assume that false is never returned.

Impact:

If the code mandates that the returned bool is true, this will cause incompatibility with tokens such as USDT / Tether as no such bool is returned to be evaluated causing the check to fail at all times. On the other hand, if the token utilized can return a false value under certain conditions but the code does not validate it, the contract itself can be compromised as having received / sent funds that it never did.

Example:

ActivePool.sol
123bool success = pulseX.transfer(_account, _amount); //Shinto: transfer pulseX

Recommendation:

Since not all standardized tokens are EIP-20 compliant (such as Tether / USDT), we advise a safe wrapper library to be utilized instead such as SafeERC20 by OpenZeppelin to opportunistically validate the returned bool only if it exists in each instance.

Alleviation (8bedd3b0df6387957e6b8f5d52507e776c1458b0):

The Powercity team has stated that they intend to utilize the PulseX token solely and that it reverts on unsuccessful transfers, rendering an evaluation of the yielded bool redundant.

As such, we consider this exhibit nullified based on the fact that a known failure-reverting EIP-20 asset will be utilized in the referenced invocations.