
@taichiaudit Founder | Whitehat doing mediations @Immunefi | Core Member @DeFiHackLabs
GMT+8
Joined January 2018
- Tweets3.1K
- Following3.9K
- Followers2.6K
- Likes8.3K
Paid $250 bucks for a mediation and got closed after 25 minutes with this response, stay away from this scam. Do not pay for mediation.
Glad to join the @HackenProof Vanguard program! Will spend more time hunting bugs on HP and share knowledge with the community馃
Passed Daml fundamentals cert exam馃榿Thanks @digitalasset for the great intro course
Translation: you passed verification but we won't allow you to do your regular job, what you gonna do about it kid?
There is a second bug that makes this path reachable much more easily: the insolvency gate is broken.
The comments say liquidation should depend on the borrower鈥檚 shortfall (the underwater amount), but calculateDiscountedRepayToEvenAmount() reads the target account鈥檚 shortfall and then never uses it. You can ctrl+f for accountShortfall_TargetUser and see it is not used anywhere in the contract.
Instead, the close cap (the maximum amount of the borrower鈥檚 debt that this liquidation is allowed to repay in one call) is effectively derived from close factor and borrow balance.
During the write phase it stores the borrower-side result, then stores the liquidator-side result.
Because both storage variables point to the same slot, the second write overwrites the first one. Net result: the slot ends up with a + b, not a neutral self-transfer.
So the liquidation repays real debt but credits extra internal collateral to the attacker.
After that, the code first computes localResults.updatedSupplyBalance_TargetCollateralAsset = localResults.currentSupplyBalance_TargetCollateralAsset - localResults.seizeSupplyAmount_TargetCollateralAsset.
It then computes localResults.updatedSupplyBalance_LiquidatorCollateralAsset = localResults.currentSupplyBalance_LiquidatorCollateralAsset + localResults.seizeSupplyAmount_TargetCollateralAsset.
You can think of this as localResults.updatedSupplyBalance_TargetCollateralAsset = a - b and updatedSupplyBalance_LiquidatorCollateralAsset = a + b.








