update vault contract

This commit is contained in:
2025-12-29 11:08:34 +08:00
parent 9a92c81aec
commit 6fe3fa93b3
2 changed files with 3 additions and 7 deletions

View File

@@ -170,7 +170,7 @@ contract YTAssetFactory is Initializable, UUPSUpgradeable, OwnableUpgradeable {
uint256[] memory _redemptionTimes,
uint256[] memory _initialYtPrices,
address _usdcPriceFeed
) external returns (address[] memory vaults) {
) external onlyOwner returns (address[] memory vaults) {
require(
_names.length == _symbols.length &&
_names.length == _managers.length &&

View File

@@ -130,7 +130,7 @@ contract YTAssetVault is
* @param _symbol YT代币符号
* @param _manager 管理员地址
* @param _hardCap 硬顶限制
* @param _usdc USDC代币地址可选传0则使用默认地址
* @param _usdc USDC代币地址
* @param _redemptionTime 赎回时间Unix时间戳
* @param _initialYtPrice 初始YT价格精度1e30传0则使用默认值1.0
*/
@@ -364,13 +364,9 @@ contract YTAssetVault is
external
nonReentrant
whenNotPaused
onlyManager
returns (uint256 processedCount, uint256 totalDistributed)
{
// 权限检查只有manager或factory可以调用
if (msg.sender != manager && msg.sender != factory) {
revert Forbidden();
}
if (_batchSize == 0) revert InvalidBatchSize();
uint256 availableUSDC = IERC20(usdcAddress).balanceOf(address(this));