Can't claim legacy safety module rewards

I’m having trouble claiming my legacy safety module claimable AAVE on mainnet. The AAVE frontend shows i have AAVE to claim, but I’m not able to claim it because of an AAVE allowance error.

I’ve been troubleshooting it and I’ve uncovered the below hypothesis. I’m not 100% sure if this is the root cause or not but it might be.

It looks like the Rewards Vault AAVE allowance for the stkAAVE contract is effectively zero (verified by calling AAVE.allowance(rewardsVault, stkAAVE)


AAVE = 0x7Fc66500c84A76Ad7e9c93437bFc5Ac33E2DDaE9
stkAAVE = 0x4da27a545c0c5b758a6ba100e3a049001de870f5
rewardsVault = 0x25F2226B597E8F9514B3F68F00f494cF4f286491

When I try to submit the claim via the aave frontend, I see this error:

cannot estimate gas; transaction may fail or may require manual gas limit
[ See: https://links.ethers.org/v5-errors-UNPREDICTABLE_GAS_LIMIT ]
(reason="execution reverted: ERC20: insufficient allowance",
 method="estimateGas",
 transaction={
   "from":<my EOA redacted>,
   "to":"0x4da27a545c0c5B758a6BA100e3a049001de870f5",
   "value":{"type":"BigNumber","hex":"0x00"},
   "data":"0x9a99b4f0000000000000000000000000<my EOA redacted>00000000000000000000000000000000000000000000000077d2f53da2c7cb68","accessList":null}, error={},
 code=UNPREDICTABLE_GAS_LIMIT, version=providers/5.7.2)

But when I force submit the transaction and debug in tenderly I see the revert happens here:

  function _spendAllowance(
    address owner,
    address spender,
    uint256 amount
  ) internal virtual {
    uint256 currentAllowance = allowance(owner, spender);
    if (currentAllowance != type(uint256).max) {
      require(currentAllowance >= amount, 'ERC20: insufficient allowance');
      unchecked {
        _approve(owner, spender, currentAllowance - amount);
      }
    }
  }

Where owner = 0x25F2226B597E8F9514B3F68F00f494cF4f286491 and spender = 0x4da27a545c0c5B758a6BA100e3a049001de870f5 which matches the above hypothesis.

Can you please advise on how I should proceed from here?

Hey

there’s an active gov proposal to increase the allowance for stkABPT/stkAAVE

Thank you! This would explain it.

Maybe it would make sense to put a note about this in the frontend for others because I lost a few hours getting to the bottom of this.

Appreciate your help.