hats-finance / Possum-Labs--Portals--0xed8965d49b8aeca763447d56e6da7f4e0506b2d3

GNU General Public License v2.0
0 stars 2 forks source link

Contributor cannot re-claim PSM tokens if `fundingRewardPool` is zero . #67

Open hats-bug-reporter[bot] opened 1 year ago

hats-bug-reporter[bot] commented 1 year ago

Github username: @pavankv241 Twitter username: @PavanKumarKv2 Submission hash (on-chain): 0xd3eab095a16a022651beb0dcfe54d264f9b90b2dc134a63434ab58eb83684c69 Severity: low

Description: Description\ The variable fundingRewardPool is only add in convert() function which is called by arbitrageurs. we can see below

        if (bToken.totalSupply() > 0 && fundingRewardsCollected < fundingMaxRewards) {
            uint256 newRewards = (FUNDING_REWARD_SHARE * AMOUNT_TO_CONVERT) / 100;
            fundingRewardPool += newRewards;
            fundingRewardsCollected += newRewards;
        }

After portal activated if contributor try to burn his btokens, at the same time no arbitrages activity is not yet started then fundingRewardPool variable will be zero and it not intialiazed at deployment period also. Then contributor cannot re-claim his PSM because amountToReceive value is based on fundingRewardPool. He has to wait until any arbitrage activity starts.

function getBurnValuePSM(uint256 _amount) public view returns(uint256 burnValue) {
        burnValue = (fundingRewardPool * _amount) / bToken.totalSupply();
    }

This function is called inside the burnBtokens().

Impact If no arbitrage activate then contributors cannot re-claim their PSM tokens.

code snippet:-

https://github.com/hats-finance/Possum-Labs--Portals--0xed8965d49b8aeca763447d56e6da7f4e0506b2d3/blob/main/contracts/Portal.sol#L638C1-L642C10

Recommendation Add some mechanism to update fundingRewardPool according to the contribution

PossumLabsCrypto commented 1 year ago

This is a double from #62