Skip to content

Commit

Permalink
feat: remove unnecessary mapping
Browse files Browse the repository at this point in the history
  • Loading branch information
failingtwice committed Jan 29, 2025
1 parent 34d203d commit 21f475e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions contracts/0.8.25/vaults/PredepositDepositGuardian.sol
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ pragma solidity 0.8.25;

import {StakingVault} from "./StakingVault.sol";

// TODO: minor UX improvement: perhaps there's way to reuse predeposits for a different validator without withdrawing
contract PredepositDepositGuardian {
uint256 public constant PREDEPOSIT_AMOUNT = 1 ether;

mapping(bytes32 validatorId => bool isPreDeposited) public validatorPredeposits;
mapping(address nodeOperator => bytes32 validatorId) public nodeOperatorValidators;
mapping(bytes32 validatorId => bytes32 withdrawalCredentials) public validatorWithdrawalCredentials;

function predeposit(
Expand Down Expand Up @@ -39,7 +39,6 @@ contract PredepositDepositGuardian {
}

validatorPredeposits[validatorId] = true;
nodeOperatorValidators[nodeOperator] = validatorId;

if (deposit.amount != PREDEPOSIT_AMOUNT) revert PredepositDepositAmountInvalid();
}
Expand Down Expand Up @@ -158,4 +157,5 @@ contract PredepositDepositGuardian {
error WithdrawValidatorTransferFailed();
error WithdrawValidatorWithdrawalCredentialsNotMatchingStakingVault();
error WithdrawSenderNotNodeOperator();
error WithdrawValidatorDoesNotBelongToNodeOperator();
}

0 comments on commit 21f475e

Please sign in to comment.