The functions onERC1155Received and onERC1155BatchReceived currently revert any incoming token transfers. While the attacker pays for the gas, repeated reverts can consume a significant portion of the block's gas limit, potentially preventing other transactions from being processed.
The TokenFacet contract has implemented onERC1155Received and onERC1155BatchReceived functions that revert on ERC1155 token transfer attempts.
An attacker repeatedly calls safeTransferFrom on an ERC-1155 token contract, targeting the TokenFacet contract.
Each call triggers the onERC1155Received or onERC1155BatchReceived function, which reverts.
The repeated reverts consume gas, filling the block's gas limit and potentially causing a DoS situation where other transactions cannot be processed.
This is a simple mock attacker contract that will be used to submit transfer requests
The AttackSimulationTest contract is used to deploy multiple instances of MockAttacker and have each instance attempt to transfer tokens to the TokenFacet contract:
The repeated reverts could consume a significant portion of the block's allocated gas limit.
Users will have to pay higher gas price to get their transactions executed
Manual review
Implement restrictions or validation logic in the onERC1155Received and onERC1155BatchReceived functions to limit the number of incoming transfers and validate token IDs and values.
Use rate limiting techniques to prevent excessive transfers in a short period.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.