Closed github-actions[bot] closed 1 year ago
Conceptually the auction phase of a Fair Funding campaign will be limited and rather short (for example first Fair Funding campaign will run 16 days / 16 auctions).
Compared to the available APYs on Alchemix (2-5% max), the discrepancy between early depositors and late depositors is effectively near zero and negligible.
Closing based on Sponsor comment, as the impact would be low
oxcm
high
[H] The protocol does not properly distribute past profits between existing and new shareholders
Summary
The contract allows users to invest ETH into the protocol and receive a proportional amount of ETH tokens in return as claimable amount accumulate over time.
However, the contract does not ensure equal profit distribution for new and existing token holders. Specifically, the contract does not settle past profits before issuing new shares, which allows new shareholders to immediately claim profits that were generated prior to their investment.
Vulnerability Detail
This issue arises from the fact that the contract does not consider the historical profits generated by the protocol when issuing new shares.
When a user invests ETH and receives share in return, the smart contract records the number of share issued, but does not settle the past profits generated by the protocol.This means that new shareholders can claim profits that were generated prior to their investment by call
withdraw_underlying_to_claim
.POC
Impact
Existing shareholders will receive less expected ETH return, as a portion of the accumulated past profits will be taken by new shares.
Code Snippet
https://github.com/sherlock-audit/2023-02-fair-funding/blob/main/fair-funding/contracts/Vault.vy#L393-L404
Tool used
Manual Review / ChatGPT PLUS
Recommendation
To address this issue, recommend updated contract implement settling all outstanding profits before issuing new shares