#37427 [SC-Critical] Delegation is not updated on slash and unlock
Previous#37443 [SC-Insight] Race Condition in KeyedBroadcaster ImplementationNextStacks I Attackathon
Last updated
Was this helpful?
Was this helpful?
function test_ShouldReduceAccountsLockedGoldBalance_WhenAccountIsSlashedForAllOfItsLockedGoldAndIsDelegating()
public
{
uint256 penalty = value;
uint256 reward = value / 2;
whenVoteSigner_LockedGoldDelegateGovernanceVotes();
vm.prank(caller);
lockedGold.delegateGovernanceVotes(delegatee1, FixidityLib.newFixedFraction(30, 100).unwrap());
assertEq(lockedGold.getAccountNonvotingLockedGold(caller), 1000);
assertEq(lockedGold.getAccountTotalLockedGold(caller), 1000);
assertEq(lockedGold.getAccountTotalGovernanceVotingPower(delegatee1), 300);
helper_WhenAccountIsSlashedForAllOfItsLockedGold(penalty, reward, delegator);
assertEq(lockedGold.getAccountNonvotingLockedGold(delegator), 0);
assertEq(lockedGold.getAccountTotalLockedGold(delegator), 0);
assertNotEq(lockedGold.getAccountTotalGovernanceVotingPower(delegatee1), 300);
}