Submitted by said
Admin can pause collateralization for a specific mode to prevent users from providing more collateral either via collateralize or collateralizeWLp. However, due to not properly using internal accounting when tracking wLP collateral, users can still provide more collateral by directly donating tokens to a specific LP tokenId.
It can be seen that when canCollateralize of certain mode is paused, collateralizeWLp should be paused.
https://github.com/code-423n4/2023-12-initcapital/blob/main/contracts/core/InitCore.sol#L243-L261
However, when calculating collateral credit, it will calculate based on balance of LP of specific token inside wLP contract.
https://github.com/code-423n4/2023-12-initcapital/blob/main/contracts/core/InitCore.sol#L456
https://github.com/code-423n4/2023-12-initcapital/blob/main/contracts/core/PosManager.sol#L125
It should be noted that most DEXs (e.g., Uniswap) allow any user to provide liquidity to any other users position. In practice, this bypasses the collateralization paused functionality.
Implement internal accounting for wLP inside the PosManager.
fez-init (INIT) acknowledged and commented:
hansfriese (Judge) commented:
