Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CS-BOLD-028 Informational 7.8: Inconsistent Input Validation by Zappers #484

Open
bingen opened this issue Oct 9, 2024 · 0 comments
Open

Comments

@bingen
Copy link
Collaborator

bingen commented Oct 9, 2024

Liquity uses separate Zapper contracts for WETH collateral and other LST collateral tokens. The contracts are inconsistent.
The WETHZapper enforces, in _adjustTrovePre(), that debt must decrease by a positive amount:

require(!_isDebtIncrease || _boldChange > 0, "WZ: Increase bold amount should not be zero");

However, GasCompZapper._adjustTrovePre() is missing that check, allowing calls with debtIncrease set to true and boldChange equal to zero:

if (_isCollIncrease || (!_isDebtIncrease && _boldChange > 0)) {
    _requireSenderIsOwnerOrAddManager(_troveId, owner);
}

If no add manager is assigned (set to address 0), anyone can call this function, but it has no effect on BorrowerOperations.adjustTrove(), as _adjustTrove() debt increases only have an effect if they are larger than 0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant