Submitted by santipu_
In Ethereum Credit Guild, when a LendingTerm is considered too risky, its GUILD voters are incentivized to offboard that term via the LendingTermOffboarding contract. This mechanism is designed to be a fast and secure way to remove a LendingTerm from a market before it accrues bad debt.
Each time that GUILD voters want to offboard a term, someone will have to call proposeOffboard() in order to start a poll. The other voters will have the ability to support this poll by calling supportOffboard(). As soon as the votes reach to a quorum, the offboard() function will have to be called to remove that term from the market and allow all loans from that term to be called.
The poll for offboarding a term has a max duration of 7 days, this restriction is enforced on proposeOffboard():
This check will enforce that nobody can propose the offboarding of a LendingTerm twice in a 7-day period.
Given that the system allows for re-onboarding terms, its possible that a LendingTerm can be offboarded and re-onboarded in less than 7 days. In such case, if market conditions turn adverse, the GUILD voters wont be able to offboard the same term for a second time; therefore, allowing for bad debt to be created and impact all the market.
Its not unfeasible to assume this situation can occur in a future given that the protocol aims for supporting thousands of terms in a market, as its stated in the docs:
GUILD voters wont be able to offboard the same term twice in a 7-day window period and that will lead to bad debt that will impact all the market and its voters. In the scenario where loans start to default, all voters for that term will be slashed and the CREDIT token of that market will experience losses.
The following coded POC can be pasted in LendingTermOffboarding.t.sol. The test can be run with the command: forge test --match-test testCannotOffboardTwiceIn7Days:
Its recommended to modify the check in proposeOffboard() in order to allow a second offboarding of a term if the previous offboarding is already complete.
As a potential solution, consider adding a mapping isPollCompleted[term] that marks true when the quorum is reached for a certain poll on supportOffboard(). This could be the new check on proposeOffboard() to mitigate this issue:
Timing
eswak (Ethereum Credit Guild) confirmed, but disagreed with severity and commented:
TrungOre (judge) decreased severity to Medium
