hats-finance / Metrom-0xfdfc6d4ac5807d7460da20a3a1c0c84ef2b9c5a2

Smart contracts for the Metrom project.
GNU General Public License v3.0
0 stars 0 forks source link

Campaign running period is ignored #49

Open hats-bug-reporter[bot] opened 5 months ago

hats-bug-reporter[bot] commented 5 months ago

Github username: @skypper Twitter username: tudoratu Submission hash (on-chain): 0x0c4f668567bc6045f828f9c0ea56129743e2a4d14a6db4f85399a45bd0abcd62 Severity: low

Description: Description\ The running period of a campaign is ignored, although each campaign is supplied a start time and end time by the campaign owner, unless the purpose of these fields is only informational.

Recommendations\ The protocol should consider the following suggested implementation (or a varation thereof):

  1. A new campaign is created having a start time and an end time which determined the running period.
  2. Once the running period passed, the distribution period starts and the updater account can distribute rewards.
  3. Once the distribution period passed, there are two outcomes:
    • the rewards have been distributed in the previous phase and now the users can claim rewards;
    • the rewards have not been distributed in the previous phase and now they can no longer be distributed, thus the campaign owner can recover the rewards.

Note that currently, in order for the campaign owner to be able to recover the rewards the updater account must first distribute all the rewards to the campaign owner which makes the check inside recoverRewards redundant. The campaign owner should be able to recover the funds as soon as the distribution period passed.

luzzif commented 5 months ago

The running period is indeed used by the backend to know when to start/stop distributing campaigns. Rewards are distributed as the campaign runs depending on the progress rate and it's intended that there's no net division between the distribution and claim time, as this makes UX smoother (eligible LPs can claim when they want as campaigns are distributed).