Skip to content

Latest commit

 

History

History
53 lines (34 loc) · 1.02 KB

023.md

File metadata and controls

53 lines (34 loc) · 1.02 KB

Melted Shadow Otter

High

Optimize fee logic is needed

Summary

The _transferWithFee function could lead to situations where the transaction exceeds the block gas limit if the transaction amount is large, especially with high fees. So it is needed to implement checks to ensure that large transfers do not inadvertently consume excessive gas.

function _transferWithFee(
    address from,
    address to,
    uint256 amount,
    uint256 fee
) internal virtual {
    uint256 amountToBurn = (amount * fee) / 10000;
    require(amount >= amountToBurn, "Transfer amount too low");
    uint256 amountAfterFee = amount - amountToBurn;
    _burn(from, amountToBurn);
    super._transfer(from, to, amountAfterFee);
}

Root Cause

https://github.com/sherlock-audit/2024-12-numa-audit/blob/main/Numa/contracts/Numa.sol#L118-L128

Internal pre-conditions

No response

External pre-conditions

No response

Attack Path

No response

Impact

No response

PoC

No response

Mitigation

No response