Low Tangerine Cod
High
optionsFeesToGetFromOtherChain being added instead of deducted from totalCdsDepositedAmountWithOptionFees
Here params.optionsFeesToGetFromOtherChain
is being substracted from totalCdsDepositedAmountWithOptionFees
totalCdsDepositedAmountWithOptionFees -= (params.cdsDepositDetails.depositedAmount - params.cdsDepositDetails.liquidationAmount + params.optionsFeesToGetFromOtherChain);
Blockchian/contracts/lib/CDSLib.sol#L731 params.optionsFeesToGetFromOtherChain is a value that later would be deducted on another chain here:
cds.updateTotalCdsDepositedAmountWithOptionFees(uint128(oappData.optionsFeesToRemove + oappData.cdsAmountToRemove + oappData.liqAmountToRemove));//all others 0
...
function updateTotalCdsDepositedAmountWithOptionFees(
uint128 _amount
) external onlyGlobalOrLiquidationContract {
// If the totalCdsDepositedAmountWithOptionFees is non zero
if (totalCdsDepositedAmountWithOptionFees != 0) {
totalCdsDepositedAmountWithOptionFees -= _amount;
}
}
This means in total from both chains:
none
none
always happening
Some cds holder will not be able to withdraw their funds due to the fact that totalCdsDepositedAmountWithOptionFees
will be less than the amount they want to withdraw with broken accounting
No response
Deduct like its done in the rest of the project
// update totalCdsDepositedAmountWithOptionFees
- totalCdsDepositedAmountWithOptionFees -= (params.cdsDepositDetails.depositedAmount - params.cdsDepositDetails.liquidationAmount + params.optionsFeesToGetFromOtherChain);
+ totalCdsDepositedAmountWithOptionFees -= (params.cdsDepositDetails.depositedAmount - params.cdsDepositDetails.liquidationAmount - params.optionsFeesToGetFromOtherChain);