audit
This commit is contained in:
@@ -193,16 +193,13 @@ contract YTPoolManager is Initializable, UUPSUpgradeable, ReentrancyGuardUpgrade
|
||||
|
||||
uint256 usdyAmount = _ytLPAmount * aumInUsdy / ytLPSupply;
|
||||
|
||||
// 先销毁ytLP
|
||||
IYTLPToken(ytLP).burn(_account, _ytLPAmount);
|
||||
|
||||
// 检查余额,只铸造差额部分
|
||||
uint256 usdyBalance = IERC20(usdy).balanceOf(address(this));
|
||||
if (usdyAmount > usdyBalance) {
|
||||
IUSDY(usdy).mint(address(this), usdyAmount - usdyBalance);
|
||||
}
|
||||
|
||||
// 转账USDY到Vault并换回代币
|
||||
IERC20(usdy).safeTransfer(ytVault, usdyAmount);
|
||||
uint256 amountOut = IYTVault(ytVault).sellUSDY(_tokenOut, _receiver);
|
||||
|
||||
@@ -225,7 +222,7 @@ contract YTPoolManager is Initializable, UUPSUpgradeable, ReentrancyGuardUpgrade
|
||||
function getAumInUsdy(bool _maximise) public view returns (uint256) {
|
||||
uint256 aum = IYTVault(ytVault).getPoolValue(_maximise);
|
||||
|
||||
aum += aumAddition; // aumAddition是协议额外增加的AUM,用来“预留风险缓冲 / 扣除潜在负债”
|
||||
aum += aumAddition;
|
||||
if (aum > aumDeduction) {
|
||||
aum -= aumDeduction;
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user