Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions foundry.lock
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
{
"lib/forge-std": {
"rev": "8e40513d678f392f398620b3ef2b418648b33e89"
"tag": {
"name": "v1.12.0",
"rev": "7117c90c8cf6c68e5acce4f09a6b24715cea4de6"
}
},
"lib/openzeppelin-contracts": {
"rev": "dbb6104ce834628e473d2173bbc9d47f81a9eec3"
},
"lib/openzeppelin-contracts-upgradeable": {
"rev": "723f8cab09cdae1aca9ec9cc1cfa040c2d4b06c1"
}
}
}
2 changes: 1 addition & 1 deletion script/DeployVault.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ contract DeployVaultScript is DeployVaultBase {
baseParams: IVault.InitParams({
collateral: COLLATERAL,
burner: BURNER,
epochDuration: EPOCH_DURATION,
withdrawalDelay: EPOCH_DURATION,
depositWhitelist: WHITELISTED_DEPOSITORS.length != 0,
isDepositLimit: DEPOSIT_LIMIT != 0,
depositLimit: DEPOSIT_LIMIT,
Expand Down
2 changes: 1 addition & 1 deletion script/DeployVaultTokenized.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ contract DeployVaultTokenizedScript is DeployVaultTokenizedBase {
baseParams: IVault.InitParams({
collateral: COLLATERAL,
burner: BURNER,
epochDuration: EPOCH_DURATION,
withdrawalDelay: EPOCH_DURATION,
depositWhitelist: WHITELISTED_DEPOSITORS.length != 0,
isDepositLimit: DEPOSIT_LIMIT != 0,
depositLimit: DEPOSIT_LIMIT,
Expand Down
2 changes: 1 addition & 1 deletion src/contracts/slasher/BaseSlasher.sol
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ abstract contract BaseSlasher is Entity, StaticDelegateCallable, ReentrancyGuard
}

if (
captureTimestamp < Time.timestamp() - IVault(vault).epochDuration() || captureTimestamp >= Time.timestamp()
captureTimestamp < Time.timestamp() - IVault(vault).withdrawalDelay() || captureTimestamp >= Time.timestamp()
|| captureTimestamp < latestSlashedCaptureTimestamp[subnetwork][operator]
) {
return (0, 0);
Expand Down
2 changes: 1 addition & 1 deletion src/contracts/slasher/Slasher.sol
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ contract Slasher is BaseSlasher, ISlasher {
slashHints = abi.decode(hints, (SlashHints));
}

if (captureTimestamp < Time.timestamp() - IVault(vault).epochDuration() || captureTimestamp >= Time.timestamp())
if (captureTimestamp < Time.timestamp() - IVault(vault).withdrawalDelay() || captureTimestamp >= Time.timestamp())
{
revert InvalidCaptureTimestamp();
}
Expand Down
10 changes: 5 additions & 5 deletions src/contracts/slasher/VetoSlasher.sol
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ contract VetoSlasher is BaseSlasher, IVetoSlasher {
}

if (
captureTimestamp < Time.timestamp() + vetoDuration - IVault(vault).epochDuration()
captureTimestamp < Time.timestamp() + vetoDuration - IVault(vault).withdrawalDelay()
|| captureTimestamp >= Time.timestamp()
) {
revert InvalidCaptureTimestamp();
Expand Down Expand Up @@ -150,7 +150,7 @@ contract VetoSlasher is BaseSlasher, IVetoSlasher {
revert VetoPeriodNotEnded();
}

if (Time.timestamp() - request.captureTimestamp > IVault(vault).epochDuration()) {
if (Time.timestamp() - request.captureTimestamp > IVault(vault).withdrawalDelay()) {
revert SlashPeriodEnded();
}

Expand Down Expand Up @@ -254,7 +254,7 @@ contract VetoSlasher is BaseSlasher, IVetoSlasher {
if (resolver_ != address(uint160(_resolver[subnetwork].latest()))) {
_resolver[subnetwork]
.push(
(IVault(vault_).currentEpochStart() + resolverSetEpochsDelay * IVault(vault_).epochDuration())
(Time.timestamp() + resolverSetEpochsDelay * IVault(vault_).withdrawalDelay())
.toUint48(),
uint160(resolver_)
);
Expand All @@ -273,8 +273,8 @@ contract VetoSlasher is BaseSlasher, IVetoSlasher {
function __initialize(address vault_, bytes memory data) internal override returns (BaseParams memory) {
(InitParams memory params) = abi.decode(data, (InitParams));

uint48 epochDuration = IVault(vault_).epochDuration();
if (params.vetoDuration >= epochDuration) {
uint48 withdrawalDelay = IVault(vault_).withdrawalDelay();
if (params.vetoDuration >= withdrawalDelay) {
revert InvalidVetoDuration();
}

Expand Down
Loading
Loading