Skip to content
Smart contracts Audit finding Intermediate

ProtocolDAO lacks a method to take out GGP

The ProtocolDAO contract lacks a method to withdraw GGP tokens that are sent to it when a validator is slashed. As a result, slashed GGP becomes stuck in the ProtocolDAO and cannot be used to compensate Liquid Stakers.

bin2chen Follow with AkshaySrivastav, hansfriese and 7 others

Originally disclosed on Code4rena

Submitted by bin2chen, also found by AkshaySrivastav, hansfriese, hansfriese, caventa, shark, RaymondFam, csanuragjain, rvierdiiev, and cozzetti

contracts/contract/Staking.sol#L379-L383

ProtocolDAO implementation does not have a method to take out GGP. So it can’t handle ggp unless it updates ProtocolDAO.

Proof of Concept

recordStakingEnd() will pass the rewards of this reward. “If the validator is failing at their duties, their GGP will be slashed and used to compensate the loss to our Liquid Stakers”

At this point slashGGP() will be executed and the GGP will be transferred to “ProtocolDAO”

staking.slashGGP():

    function slashGGP(address stakerAddr, uint256 ggpAmt) public onlySpecificRegisteredContract("MinipoolManager", msg.sender) {
        Vault vault = Vault(getContractAddress("Vault"));
        decreaseGGPStake(stakerAddr, ggpAmt);
        vault.transferToken("ProtocolDAO", ggp, ggpAmt);
    }

But the current ProtocolDAO implementation does not have a method to take out GGP. So it can’t handle ggp unless it updates ProtocolDAO

Recommended Mitigation Steps

1.transfer GGP to ClaimProtocolDAO or 2.Similar to ClaimProtocolDAO, add spend method to retrieve GGP

contract ProtocolDAO is Base {
...

+    function spend(
+        address recipientAddress,
+        uint256 amount
+    ) external onlyGuardian {
+        Vault vault = Vault(getContractAddress("Vault"));
+        TokenGGP ggpToken = TokenGGP(getContractAddress("TokenGGP"));
+
+        if (amount == 0 || amount > vault.balanceOfToken("ProtocolDAO", ggpToken)) {
+            revert InvalidAmount();
+        }
+
+        vault.withdrawToken(recipientAddress, ggpToken, amount);
+
+        emit GGPTokensSentByDAOProtocol(address(this), recipientAddress, amount);
+   }

Alex the Entreprenerd (judge) increased severity to High and commented:

The Warden has shown how, due to a lack of sweep the default contract for fee handling will be unable to retrieve tokens sent to it.

While the issue definitely would have been discovered fairly early in Prod, the in-scope system makes it clear that the funds would have been sent to ProtocolDAO.sol and would have been lost indefinitely.

For this reason, I believe the finding to be of High Severity.

emersoncloud (GoGoPool) commented:

Acknowledged.

Thanks for the report. This is something we’re aware of and are not going to fix at the moment.

The funds are transferred to the Vault and the ProtocolDAO contract is upgradeable. Therefore in the future we can upgrade the contract to spend the Vault GGP tokens to return funds to Liquid Stakers.

We expect slashing to be a rare event and might have some manual steps involved in the early days of the protocol to do this process if it occurs.


The original report as published on Code4rena, by bin2chen. Images and videos are our own copies; raw HTML is shown as text. View it on Code4rena.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

How it worked

Root cause

The ProtocolDAO contract lacks a function to transfer or spend GGP tokens, so any GGP sent to it becomes permanently locked.

Impact

Slashed GGP tokens sent to ProtocolDAO become permanently stuck and cannot be used to compensate Liquid Stakers, though the team notes the contract is upgradeable and slashing is expected to be rare.

What the attacker needed

A validator is slashed; slashing occurs

The fix

The report recommends either transferring GGP to ClaimProtocolDAO or adding a spend function to ProtocolDAO; the team acknowledged the issue but stated they are not going to fix it at the moment, citing the upgradeable contract and rarity of slashing.

How it was found

  1. A validator fails at their duties and their GGP is slashed.
  2. The slashGGP function transfers the slashed GGP to the ProtocolDAO contract.
  3. The ProtocolDAO contract has no method to withdraw or spend GGP, so the tokens remain stuck.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

When a validator misbehaves, their GGP tokens are taken away and sent to a special contract called ProtocolDAO. But that contract has no way to send those tokens out again, so the tokens are stuck there forever. This means the people who were supposed to be compensated never receive the tokens.

What is Smart contracts?

Flaws in on-chain code that let an attacker drain funds, freeze them or break the protocol's accounting.

More by bin2chen

View all

139 more disclosed reports, best first.

More from GoGoPool contest

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Smart contract vulnerabilities

The lesson behind this report.

Flaws in on-chain code that let an attacker drain funds, freeze them or break the protocol's accounting.