Abstract: This paper presents FrontDef, a security system to detect and front-run malicious transactions to mitigate financial loss caused by smart contract attacks. FrontDef monitors each transaction in the pending transaction pool to detect potential attacks. For each suspicious transaction, FrontDef analyzes the bytecode of the contract the transaction attempts to interact and assembles a sequence of mimic transactions to replicate the attack strategy. FrontDef then uses the assembled transactions to front- run the suspicious attack transaction to prevent financial loss. Empirical results show that FrontDef can successfully detect and assemble mimic transactions for all of the 24 benchmark cases that includes 21 historical attacks that occurred on Ethereum and Binance Smart Chain (BSC). They also confirm that FrontDef can process up to 1230 transactions per second, which currently is greater than the maximum throughput of Ethereum and BSC.
Loading