Submitted by 0xdeadbeef0x
The protocol has set a limitation on who can participate in the protocol activities.
Users who are #2 that deposited funds into the protocol are not able to redeem collateral tokens and withdraw their profits/funds from the market. (Loss of funds).
When a user has deposited, the protocol checks if the user is permitted to participate in the protocol activities by checking #1 and #2 from the Impact section. The check is done in the hook function in DepositHook:
https://github.com/prepo-io/prepo-monorepo/blob/3541bc704ab185a969f300e96e2f744a572a3640/apps/smart-contracts/core/contracts/DepositHook.sol#L45
After a user has deposited and received collateral tokens, he will trade it in uniswap pools to receive Long/Short tokens either manually or through the depositAndTrade function.
When the user decided to redeem through the market in order to receive the collateral tokens and his funds/profits, the user will not be able to receive it  because only users that are in the account list (#1) will pass the checks. Users who participated because they own NFT (#2) will get a revert when calling the function.
redeem in PrePOMarket:
https://github.com/prepo-io/prepo-monorepo/blob/3541bc704ab185a969f300e96e2f744a572a3640/apps/smart-contracts/core/contracts/PrePOMarket.sol#L96
hook function in RedeemHook:
https://github.com/prepo-io/prepo-monorepo/blob/3541bc704ab185a969f300e96e2f744a572a3640/apps/smart-contracts/core/contracts/RedeemHook.sol#L18
As you can see above, only users that are in the account list will be able to redeem. NFT holders will receive a revert of redeemer not allowed.
There is an already implemented test where hook will revert if the user is not in the allowed list:
https://github.com/prepo-io/prepo-monorepo/blob/3541bc704ab185a969f300e96e2f744a572a3640/apps/smart-contracts/core/test/RedeemHook.test.ts#L128
VS Code, Hardhat
Add an additional check in DepositHook to NFT holders through NFTScoreRequirement.
ramenforbreakfast (prePO) disputed and commented:
Picodes (judge) commented:
ramenforbreakfast (prePO) commented:
Picodes (judge) commented:
ramenforbreakfast (prePO) commented:
Picodes (judge) decreased severity to Medium and commented:
