Lucene search

K
code423n4Code4renaCODE423N4:2023-02-GOGOPOOL-MITIGATION-CONTEST-FINDINGS-ISSUES-61
HistoryFeb 15, 2023 - 12:00 a.m.

Slashed amount may not be cover the staker reward payout

2023-02-1500:00:00
Code4rena
github.com
5
staking
protocol
slashed amount
staked avax
ggp token
reward payout
vulnerability impact

Lines of code

Vulnerability details

Impact

Slashed amount may not be cover the staker reward payout

Proof of Concept

In the current fix, <https://github.com/multisig-labs/gogopool/pull/41&gt;

If the staked balance cannot cover the slashed amount, seize the staked balance.

Staking staking = Staking(getContractAddress("Staking"));
if (staking.getGGPStake(owner) &lt; slashGGPAmt) {
	slashGGPAmt = staking.getGGPStake(owner);
}
setUint(keccak256(abi.encodePacked("minipool.item", index, ".ggpSlashAmt")), slashGGPAmt);

The purpose of slashing the staked balance of the pool creator is to make sure that when the validators has error, the staker can still get the reward, however, if the node operator (pool creator) has no staked balance to slash, there can be little fund to payout the stakerโ€™s reward even after slashing.

If the cost of running the node is larger than the reward + the slashed amount, there can be no incentive for the pool creator to operate the node, the node operator knows he at most lose the slashed amount.

For example, the expected slashed amount is 1000 amount of GGP, yet there is only 100 GGP token left in the stakerโ€™s balance, then 100 GGP is slashed and the staker avoid being slashed by 1000 amount of GGP.

Tools Used

Manual Review

Recommended Mitigation Steps

We recommend the protocol begin slash the staked AVAX if the staked GGP token amount cannot cover the slashed amount.


The text was updated successfully, but these errors were encountered:

All reactions