Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TASK] slash_delegator - slash maximum possible #892

Open
1xstj opened this issue Jan 21, 2025 · 0 comments
Open

[TASK] slash_delegator - slash maximum possible #892

1xstj opened this issue Jan 21, 2025 · 0 comments

Comments

@1xstj
Copy link
Contributor

1xstj commented Jan 21, 2025

// Calculate and apply slash
			let slash_amount = percentage.mul_floor(delegation.amount);
			// TODO: IF SLASH AMOUNT IS GREATER THAN DELEGATION AMOUNT
			// TODO: WE WOULD RATHER TAKE THE ENTIRE DELEGATION, NO?
			delegation.amount = delegation
				.amount
				.checked_sub(&slash_amount)
				.ok_or(Error::<T>::InsufficientStakeRemaining)?;

if delegation.amount is less than slash then slash (max(slash_amount, delegation_amount))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant