-
Notifications
You must be signed in to change notification settings - Fork 8
Open
Description
On veDelegate.vet there are some nodes that have been delegated to staking wallets using delegateNode(address delegatee).
Some nodes have been burned after the delegation, because their VET balance went below the required threshold for XNodes.
The NodeManagement contract does not automatically update the delegation in these scenarios, keeping the delegation active.
Given that scenario, when the previous owner or staking wallet wants to remove the delegation using removeNodeDelegation, then it will revert with NodeManagementNonNodeHolder because the new node owner is now address(0).
A potential fix would be to use add another function that accepts the nodeId and allows delegatees to remove the delegation.
function rejectNodeDelegation(uint256 nodeId) public virtual {
NodeManagementStorage storage $ = _getNodeManagementStorage();
// Check if node is delegated and the sender is the delegatee
address delegatee = $.nodeIdToDelegatee[nodeId];
if (delegatee == address(0) || msg.sender != delegatee) {
revert NodeManagementNodeNotDelegated();
}
// Remove delegation
$.delegateeToNodeIds[delegatee].remove(nodeId);
delete $.nodeIdToDelegatee[nodeId];
// Emit event for delegation removal
emit NodeDelegated(nodeId, delegatee, false);
}Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels