QA Report #277
Labels
bug
Something isn't working
QA (Quality Assurance)
Assets are not at risk. State handling, function incorrect as to spec, issues with clarity, syntax
[QA-1]
_router
is not used inrepayAavePortalFor
functionrepayAavePortalFor
function saysThis allows anyone to repay the portal in the adopted asset for a given router and transfer
but the argument_router
is not used at all.https://github.com/code-423n4/2022-06-connext/blob/main/contracts/contracts/core/connext/facets/PortalFacet.sol#L115-L126
[QA-2]
repayAavePortal
function can set underflown value ats.routerBalances[msg.sender][_local]
Random people can call
repayAavePortal
function and set underflown value ats.routerBalances[msg.sender][_local]
.This part decrements balance in the unchecked statement.
https://github.com/code-423n4/2022-06-connext/blob/main/contracts/contracts/core/connext/facets/PortalFacet.sol#L107-L109
When
adopted
is local asset andAssetLogic.swapFromLocalAssetIfNeededForExactOut
returns(true, _amount, _asset)
, it may reach tos.routerBalances[msg.sender][_local] -= amountIn
.https://github.com/code-423n4/2022-06-connext/blob/4dd6149748b635f95460d4c3924c7e3fb6716967/contracts/contracts/core/connext/libraries/AssetLogic.sol#L244-L247
As a result, when
s.routerBalances[msg.sender][_local]
is 0 or small value, it is possible that the underflow happens ats.routerBalances[msg.sender][_local] -= amountIn
which results in having giant value ats.routerBalances[msg.sender][_local]
which seems not ideal. Removingunchecked
from this part can prevent such situations.The text was updated successfully, but these errors were encountered: