Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 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
190 changes: 2 additions & 188 deletions consts/roles.ts
Original file line number Diff line number Diff line change
@@ -1,192 +1,6 @@
import { keccak256, toHex } from 'viem/utils';
import { Hex } from 'viem';
import { VAULTS_ALL_ROLES_MAP } from 'modules/vaults';

/**
* @notice Permission for funding the StakingVault.
*/
export const FUND_ROLE = keccak256(toHex('vaults.Permissions.Fund'));

/**
* @notice Permission for withdrawing funds from the StakingVault.
*/
export const WITHDRAW_ROLE = keccak256(toHex('vaults.Permissions.Withdraw'));

/**
* @notice Permission for locking ether on StakingVault.
*/
export const LOCK_ROLE = keccak256(toHex('vaults.Permissions.Lock'));

/**
* @notice Permission for minting stETH shares backed by the StakingVault.
*/
export const MINT_ROLE = keccak256(toHex('vaults.Permissions.Mint'));

/**
* @notice Permission for burning stETH shares backed by the StakingVault.
*/
export const BURN_ROLE = keccak256(toHex('vaults.Permissions.Burn'));

/**
* @notice Permission for rebalancing the StakingVault.
*/
export const REBALANCE_ROLE = keccak256(toHex('vaults.Permissions.Rebalance'));

/**
* @notice Permission for pausing beacon chain deposits on the StakingVault.
*/
export const PAUSE_BEACON_CHAIN_DEPOSITS_ROLE = keccak256(
toHex('vaults.Permissions.PauseDeposits'),
);

/**
* @notice Permission for resuming beacon chain deposits on the StakingVault.
*/
export const RESUME_BEACON_CHAIN_DEPOSITS_ROLE = keccak256(
toHex('vaults.Permissions.ResumeDeposits'),
);

/**
* @notice Permission for requesting validator exit from the StakingVault.
*/
export const REQUEST_VALIDATOR_EXIT_ROLE = keccak256(
toHex('vaults.Permissions.RequestValidatorExit'),
);

/**
* @notice Permission for triggering validator withdrawal from the StakingVault using EIP-7002 triggerable exit.
*/
export const TRIGGER_VALIDATOR_WITHDRAWAL_ROLE = keccak256(
toHex('vaults.Permissions.TriggerValidatorWithdrawal'),
);

/**
* @notice Permission for voluntary disconnecting the StakingVault.
*/
export const VOLUNTARY_DISCONNECT_ROLE = keccak256(
toHex('vaults.Permissions.VoluntaryDisconnect'),
);

/**
* @notice Node operator manager role:
* - confirms confirm expiry;
* - confirms ownership transfer;
* - assigns NODE_OPERATOR_FEE_CONFIRM_ROLE;
* - assigns NODE_OPERATOR_FEE_CLAIM_ROLE.
*/
export const NODE_OPERATOR_MANAGER_ROLE = keccak256(
toHex('vaults.NodeOperatorFee.NodeOperatorManagerRole'),
);

/**
* @notice Claims node operator fee.
*/
export const NODE_OPERATOR_FEE_CLAIM_ROLE = keccak256(
toHex('vaults.NodeOperatorFee.FeeClaimRole'),
);

export const RECOVER_ASSETS_ROLE = keccak256(
toHex('vaults.Dashboard.RecoverAssets'),
);

/**
* @notice Adjusts rewards to allow fee correction during side deposits or consolidations
*/
export const NODE_OPERATOR_REWARDS_ADJUST_ROLE = keccak256(
toHex('vaults.NodeOperatorFee.RewardsAdjustRole'),
);

/**
* @notice Permission for getting compensation for disproven validator predeposit from PDG
*/
export const PDG_COMPENSATE_PREDEPOSIT_ROLE = keccak256(
toHex('vaults.Permissions.PDGCompensatePredeposit'),
);

/**
* @notice Permission for proving valid vault validators unknown to the PDG
*/
export const PDG_PROVE_VALIDATOR_ROLE = keccak256(
toHex('vaults.Permissions.PDGProveValidator'),
);

/**
* @notice Permission for unguarnateed deposit to trusted validators
*/
export const UNGUARANTEED_BEACON_CHAIN_DEPOSIT_ROLE = keccak256(
toHex('vaults.Permissions.UnguaranteedBeaconChainDeposit'),
);

/**
* @dev Permission for deauthorizing Lido VaultHub from the StakingVault.
*/
export const LIDO_VAULTHUB_DEAUTHORIZATION_ROLE = keccak256(
toHex('vaults.Permissions.LidoVaultHubDeauthorization'),
);

/**
* @dev Permission for granting authorization to Lido VaultHub on the StakingVault.
*/
export const LIDO_VAULTHUB_AUTHORIZATION_ROLE = keccak256(
toHex('vaults.Permissions.LidoVaultHubAuthorization'),
);

/**
* @dev Permission for ossifying the StakingVault.
*/
export const OSSIFY_ROLE = keccak256(toHex('vaults.Permissions.Ossify'));

/**
* @dev Permission for setting depositor on the StakingVault.
*/
export const SET_DEPOSITOR_ROLE = keccak256(
toHex('vaults.Permissions.SetDepositor'),
);

/**
* @dev Permission for resetting locked amount on the disconnected StakingVault.
*/
export const RESET_LOCKED_ROLE = keccak256(
toHex('vaults.Permissions.ResetLocked'),
);

/**
* @dev Permission for requesting change of tier on the OperatorGrid.
*/
export const REQUEST_TIER_CHANGE_ROLE = keccak256(
toHex('vaults.Permissions.RequestTierChange'),
);

/**
* @notice default vault admin role.
*/
export const DEFAULT_ADMIN_ROLE =
'0x0000000000000000000000000000000000000000000000000000000000000000' as Hex;

export const permissions = {
FUND_ROLE,
WITHDRAW_ROLE,
LOCK_ROLE,
MINT_ROLE,
BURN_ROLE,
REBALANCE_ROLE,
PAUSE_BEACON_CHAIN_DEPOSITS_ROLE,
RESUME_BEACON_CHAIN_DEPOSITS_ROLE,
REQUEST_VALIDATOR_EXIT_ROLE,
TRIGGER_VALIDATOR_WITHDRAWAL_ROLE,
VOLUNTARY_DISCONNECT_ROLE,
RECOVER_ASSETS_ROLE,
NODE_OPERATOR_FEE_CLAIM_ROLE,
NODE_OPERATOR_REWARDS_ADJUST_ROLE,
PDG_COMPENSATE_PREDEPOSIT_ROLE,
PDG_PROVE_VALIDATOR_ROLE,
UNGUARANTEED_BEACON_CHAIN_DEPOSIT_ROLE,
LIDO_VAULTHUB_DEAUTHORIZATION_ROLE,
LIDO_VAULTHUB_AUTHORIZATION_ROLE,
OSSIFY_ROLE,
SET_DEPOSITOR_ROLE,
RESET_LOCKED_ROLE,
REQUEST_TIER_CHANGE_ROLE,
};
export const permissions = VAULTS_ALL_ROLES_MAP;

export const permissionsKeys = Object.keys(permissions) as PERMISSION[];
export type EntirePermissionsType = typeof permissions;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export const SubmitButton = () => {

return (
<PermissionedSubmitButton
dashboardRole="burner"
dashboardRole="repayer"
type="submit"
disabled={disabled}
>
Expand Down
143 changes: 1 addition & 142 deletions features/create-vault/consts.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { MainSettingsEntryType, PermissionsRoles } from './types';
import { MainSettingsEntryType } from './types';

export const CREATE_VAULT_STEPS = 2;

Expand Down Expand Up @@ -73,147 +73,6 @@ export const MAIN_SETTINGS: MainSettingsEntryType[] = [
},
];

export const VAULT_MANAGER_PERMISSIONS_LIST: PermissionsRoles[] = [
{
role: 'funder',
title: 'Mint ETH',
tooltip: 'Allows Funding ETH',
},
{
role: 'withdrawer',
title: 'Repay ETH',
tooltip: 'Allows Withdrawing unlocked ETH from stVault',
},
{
role: 'minter',
title: 'Mint stETH',
tooltip: 'Allows Minting stETH (considering ReserveRatio)',
},
{
role: 'burner',
title: 'Burn stETH',
tooltip: 'Allows Burning stETH',
},
{
role: 'depositsPauser',
title: 'Pause Deposits to Validators',
tooltip:
'Allows requesting the Node Operator to pause deposits to Validators to keep available ETH on the Vault balance.',
},
{
role: 'depositsResumer',
title: 'Resume Deposits to Validators',
tooltip:
'Allows informing the Node Operator that deposits to Validators can be resumed.',
},

{
role: 'validatorWithdrawalTrigger',
title: 'Force Withdrawals ETH from Validator',
tooltip:
'Allows forced withdrawing ETH from validator and returning it to Vault balance.',
},
{
role: 'validatorExitRequester',
title: 'Request Node Operator to Exit Validator',
tooltip:
'Allows creating a request for Node Operator to exit a validator and return all ETH from this validator to the Vault balance.',
},
{
role: 'rebalancer',
title: 'Re-balance unhealthy Vault',
tooltip: 'Allows rebalancing stVault if Health rate < 100%.',
},
{
role: 'volunataryDisconnecter',
title: 'Voluntary disconnect Vault from Lido Vault Hub',
tooltip: 'Allows voluntary disconnecting stVault from the Lido Vault Hub.',
},
{
role: 'assetRecoverer',
title: 'Recover tokens from Dashboard contract',
tooltip: 'Allows to recover ERC20 & NFTs from the Dashboard contract.',
},
{
role: 'depositorSetter',
title: 'Set vault depositorin unconnected vault',
tooltip:
'Allows to change the vault depositor when not connected to Lido Vault Hub.',
},
{
role: 'lockResetter',
title: 'Reset lock amount in unconnected vault',
tooltip:
'Allows to reset lock amount when not connected to Lido Vault Hub.',
},

{
role: 'locker',
title: 'Increase lock amount in unconnected vault',
tooltip:
'Allows to increase lock amount when not connected to Lido Vault Hub.',
},

{
role: 'ossifyer',
title: 'Ossify vault',
tooltip:
'Allows to ossify vault implementation when not connected to Lido Vault Hub. Prevents changes to the vault.',
},

{
role: 'pdgCompensater',
title: 'Compensate disproven validator in PDG',
tooltip:
'Allows to return predeposted ETH from validator if it was proven invalid in PDG',
},

{
role: 'pdgProver',
title: 'Prove unknown validator in PDG',
tooltip: 'Allows to prove validators with correct credentials to PDG ',
},

{
role: 'unguaranteedDepositor',
title: 'Perform unguaranteed deposit to beacon chain',
tooltip:
'Allows to withdraw vault funds and perform unguaranteed deposit to beacon chain',
},

{
role: 'tierChangeRequester',
title: 'Request tier change in Operator Grid',
tooltip: 'Allows to request tier change in Operator Grid',
},

{
role: 'vaultHubAuthorizer',
title: 'Authorize Lido VaultHub to the vault',
tooltip: 'Allows to authorize Lido VaultHub to the vault',
},
{
role: 'vaultHubDeathorizer',
title: 'Deauthorize Lido VaultHub to the vault',
tooltip: 'Allows to deauthorize Lido VaultHub to the vault',
},
];

export const NO_MANAGER_PERMISSION_LIST: PermissionsRoles[] = [
{
role: 'nodeOperatorFeeClaimer',
title: 'ClaimPage Node Operator’s Accumulated Fees',
tooltip:
'Allows claiming accumulated Node Operator’s fee. Claimer provides an address to receive fees.',
},
{
role: 'nodeOperatorRewardsAdjuster',
title: 'Adjust Node Operator’s Rewards',
tooltip:
'Allows to adjust accrued rewards(due to side deposits or consolidations) to decrease claimable fee',
},
];

export enum CREATE_VAULT_FORM_STEPS {
main,
confirm,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,13 @@ import { ConfirmationAction } from 'features/create-vault/create-vault-form/conf
import { ConfirmationVaultInfo } from 'features/create-vault/create-vault-form/confirmation/confirmation-vault-info';
import { SectionContainer } from 'features/create-vault/styles';

import { CREATE_VAULT_FORM_STEPS, MAIN_SETTINGS } from '../../consts';
Comment thread
Jeday marked this conversation as resolved.
Outdated

import { ConfirmationVaultInfoProps } from './confirmation-vault-info/confirmation-vault-info';
import {
CREATE_VAULT_FORM_STEPS,
MAIN_SETTINGS,
NO_MANAGER_PERMISSION_LIST,
VAULT_MANAGER_PERMISSIONS_LIST,
} from '../../consts';

import { ConfirmationVaultInfoProps } from './confirmation-vault-info/confirmation-vault-info';
} from 'modules/vaults';

const confirmationList: ConfirmationVaultInfoProps[] = [
{
Expand Down
Loading
Loading