Upgrading PerpetualManager contract

Hey everyone,

Context

I am coming here to propose a really small protocol upgrade.
We are currently working on a router that will reduce the number of approvals needed to interact with the protocol. Some basic features of the router:

  • just one approval needed to interact with the protocol (to mint, deposit, open perp, stake in gauge)
  • being able to deposit and stake your sanTokens in just one transaction
  • claim your rewards when you are a veANGLE holder and stake them
  • claim all your ANGLE rewards at once (from gauges and perps)

There is a thing with this last feature which makes complex from a UI perspective, to get reward for a vault, you need the owner of the vault to have given approval to the contract which is going to claim rewards on their behalf.

    function getReward(uint256 perpetualID) external whenNotPaused onlyApprovedOrOwner(msg.sender, perpetualID) {
        _getReward(perpetualID, perpetualData[perpetualID].committedAmount * perpetualData[perpetualID].entryRate);
    }

This is a feature which you don’t find in other staking contracts, like for instance on Curve liquidity gauges, anyone can claim rewards on behalf of anyone and rewards would still flow to the address which has accumulated all these rewards.

Proposal

What we propose here is to upgrade the PerpetualManagerFront contract to remove this: onlyApprovedOrOwner(msg.sender, perpetualID) modifier in the function to claim rewards.

This will allow anyone to claim rewards easily from the front without having to approve the router (when it’s live) for all their perps.