#46676 [SC-Insight] Unrestricted Minimum Lockup Period
Description
Brief/Intro
Vulnerability Details
fn deploy_vault(
ref self: ContractState,
vault_owner: ContractAddress,
vault_operator: ContractAddress,
paraclear: ContractAddress,
underlying: ContractAddress,
profit_share_percentage: u128,
tvl_limit: u128,
lockup_period_seconds: u128,
) -> ContractAddress {
self._assert_only_owner();
assert(
profit_share_percentage <= self.max_profit_share_percentage(),
Errors::INVALID_PROFIT_SHARE,
);
assert(
lockup_period_seconds <= self.max_lockup_period_seconds(),
Errors::INVALID_LOCKUP_PERIOD,
);
}
fn set_lockup_period_seconds(ref self: ContractState, new_lockup_period_seconds: u128) {
let caller = get_caller_address();
assert(caller == self.owner(), Errors::INVALID_CALLER);
assert(
new_lockup_period_seconds <= self.lockup_period_seconds(),
Errors::LOCKUP_PERIOD_INCREASE,
);
self._set_lockup_period_seconds(new_lockup_period_seconds);
self
.emit(
VaultLockupPeriodUpdated {
caller: caller, lockup_period_seconds: new_lockup_period_seconds,
},
);
}Impact Details
Reference Links
Proof of Concept
Proof of Concept
Previous#46675 [SC-Insight] Insufficient Time Validation in function settle_trade_v2Next#46747 [SC-Insight] Self-Referral Vulnerability in Account Referral System
Was this helpful?