Malicious user can spam the receive()
function in the Minter
contract.
#64
Labels
receive()
function in the Minter
contract.
#64
Github username: --
Twitter username: --
Submission hash (on-chain): 0x24a872d04a702d6995f03938931241f75da9a45de1314d2fd7c49c16ad373ae5
Severity: low
Description:
Description
The
receive()
function in theMinter
contract emits an event for every transfer to the contract.It might be used in the UI to handle native transfers to the contract.
However, there is no minimum transfer amount enforced, and the gas fees on
OASIS Sapphire
are much lower compared toEthereum
. Therefore, a malicious user could spam this event by transferring just 1 wei as many times as possible.Recommendation
Consider setting a minimum transfer amount for the
receive()
function.receive() external payable { + require(msg.value > MIN_TRANSFER); emit FundsReceived(msg.sender, msg.value); }
The text was updated successfully, but these errors were encountered: