hats-finance / OLD-Accumulated-finance-0x75278bcc0fa7c9e3af98654bce195eaf3bb6a784

MIT License
0 stars 0 forks source link

Pause mechanism not implemented #28

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

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

Github username: -- Twitter username: -- Submission hash (on-chain): 0x7f966451bbf3678f669accab03121f2cf09145965ddc6e15665452a6f687c5eb Severity: low

Description: Description\ The pause mechanism has not been implemented, which would allow users to deposit even during restricted periods. Withdrawals can be allowed, but the deposit functionality must be prevented in specific situations

Attack Scenario\ "If any security issue occurs in the protocol, the deposit function allows users to make deposits, which may lead to a direct loss of funds

Attachments

  1. Proof of Concept (PoC) File

    function deposit(uint256 amount, address receiver) public virtual nonReentrant {
        require(amount > 0, "ZeroDeposit");
        uint256 mintAmount = previewDeposit(amount);
        require(mintAmount > 0, "ZeroMintAmount");
        baseToken.safeTransferFrom(address(msg.sender), address(this), amount);
        stakingToken.mint(receiver, mintAmount);
        emit Deposit(address(msg.sender), receiver, amount);
    }
  2. Revised Code File (Optional) https://github.com/AccumulatedFinance/contracts-v2/blob/master/contracts/Minter.sol#L1871C4-L1878C6

Recommendation

Implement pause and not pause mechanism iin deposit function.

0xRizwan commented 1 month ago

Invalid issue.

This issue is more about suggestion/design feature. I believe, not implementing contract pause feature is intended design of protocol. Further, this issue is OOS as per following contest rule.

Issues about code/project quality which do not lead to exploitable vulnerabilities