From the course: Blockchain and Smart Contracts Security

Unlock the full course today

Join today to access over 24,700 courses taught by industry experts.

Smart contracts threats: Part two

Smart contracts threats: Part two

- [Instructor] Origins of the front-running attack are from the traditional financial markets. Since all of the transactions before recording into the blockchain are stored in mempool, short for memory pool, they are visible to everyone. Attackers can take advantage of this information and get to the so-called the front of the line and get their transaction executed first. Now, the transactions that are sitting in the memory pool will eventually be picked up to become part of a block yet to be added into the blockchain. But how is it decided which transaction will be picked up first? Well, that depends upon the fees that are set by the user. Higher the fee, the higher the incentive for the block creator to pick a transaction over the other. The front-running attack exploits this weakness by placing a transaction before the other transactions. CWE-362 states "The program contains a code sequence that can run concurrently…

Contents