hats-finance / Metrom-0xfdfc6d4ac5807d7460da20a3a1c0c84ef2b9c5a2

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

add pause/unpause function in the metrom contract #38

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

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

Github username: @0Ksecurity Twitter username: -- Submission hash (on-chain): 0x410004a9ab4a297ddb932bfdeb47b53f320d06214693d31fae1c00ef64201a11 Severity: medium

Description: Description\ the metrom contract allow user to create campaign for specific pool and adding any erc20 tokens as reward tokens, then user can claim their reward by calling claimFunction, while the contract allow setting any erc20 tokens as reward tokens there is tokens that get paused by their admin, if this happened then any call to the claimRewards will revert and cause loss of gas to the LPs/users.

Attack Scenario\

Attachments

  1. Revised Code File (Optional) add pause function that the campaign owner can pause its reward distribution and add unpause function that can be called by trusted addresses determined by metrom protocol.

Files:

luzzif commented 6 months ago

In this specific case users can still recover all the other rewards just fine by only specifying claim bundles for them, leaving out the claim bundle for the paused token. Then, when the ZIL token is unpaused, they can also claim that without any issue. It seems extremely overkill to pause the entire contract because of some token not being able to be claimed when the users themselves can work around this by crafting their claim transactions in a certain way.