Skip to content

Commit

Permalink
add a withdrawal event when withdrawing WETH to vault (#2059)
Browse files Browse the repository at this point in the history
  • Loading branch information
sparrowDom committed May 13, 2024
1 parent 3687fbe commit 6df4f5f
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -261,4 +261,8 @@ contract NativeStakingSSVStrategy is
"eth not from allowed contracts"
);
}

function wethWithdrawnToVault(uint256 _amount) internal override {
emit Withdrawal(WETH_TOKEN_ADDRESS, address(0), _amount);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,8 @@ abstract contract ValidatorAccountant is ValidatorRegistrator {
IWETH9(WETH_TOKEN_ADDRESS).deposit{ value: wethToVault }();
// slither-disable-next-line unchecked-transfer
IWETH9(WETH_TOKEN_ADDRESS).transfer(VAULT_ADDRESS, wethToVault);

wethWithdrawnToVault(wethToVault);

emit AccountingFullyWithdrawnValidator(
fullyWithdrawnValidators,
activeDepositedValidators,
Expand Down Expand Up @@ -162,6 +163,8 @@ abstract contract ValidatorAccountant is ValidatorRegistrator {
IWETH9(WETH_TOKEN_ADDRESS).transfer(VAULT_ADDRESS, ethRemaining);
activeDepositedValidators -= 1;

wethWithdrawnToVault(ethRemaining);

emit AccountingValidatorSlashed(
activeDepositedValidators,
ethRemaining
Expand Down Expand Up @@ -233,4 +236,11 @@ abstract contract ValidatorAccountant is ValidatorRegistrator {
// unpause since doAccounting was successful
_unpause();
}

/***************************************
Abstract
****************************************/

/// @dev allows for NativeStakingSSVStrategy contract to emit Withdrawal event
function wethWithdrawnToVault(uint256 _amount) internal virtual;
}

0 comments on commit 6df4f5f

Please sign in to comment.