Giter Club home page Giter Club logo

learn-evm-attacks's Introduction

Learn EVM Attacks

A collection of Foundry tests reproducing exploits, bug bounty reports, and theoretical vulnerabilities on EVM chains. Diagrams and context links accompany each attack reproduction to make it more helpful as a reference or study material for anyone trying to learn more about vulnerabilities in smart contract systems.

Want to take a quick look? Just go to a vulnerability folder (say, MBCToken). Read the README or jump ahead to running the reproduction in your computer! You only need Foundry installed.

$ git clone https://github.com/coinspect/learn-evm-attacks
$ forge install
$ forge test --match-contract Exploit_MBCToken -vvv

Index

We now have 31 reproduced exploits. Of those 31, we have chosen a few in case you want to start studying up with some of the most interesting ones.

  • Furucombo is an excellent way to show the dangers of DELEGATECALL.
  • MBC Token is a primer on how sandwich attacks can be made with an interesting backstory on suspicious tokenomics.
  • Uranium is a great excuse to study up on the actual code that guards the famouse AMM constant product x*y=k.

To run an specific exploit, you can just use:

forge test --match-contract Exploit_MBCToken -vvv

Vary the amount of verbosity (-v, -vv...) according to the data you want. -vvvv includes traces!

The full list is below:

Access Control

Bad Data Validation

Business Logic

Reentrancy

Bridges

Contributing

To contribute, create a new file inside the most appropriate category. Use the template.txt file in the test folder including the information related to the attack.

Utils that perform flashloans and swaps are provided in test/utils to ease the job of reproducing future attacks. Also, modules that provide enhanced features to Foundry are included in the test/modules folder.

The tests should pass if the attacker succeeded, for examples: your requires should show that the attacker has more balance after the attack than before.

Past work and further study

  • DefiHackLabs has a similar repository with more exploits and more focus on the test reproductions alone, with no context or further explanations. It is nevertheless great if you only care about the attack reproductions! Go check it out.

learn-evm-attacks's People

Contributors

nine-december avatar joaquinlpereyra avatar tiassumpcao avatar juli avatar donequis avatar manylov avatar

Stargazers

Smith Noorah  avatar Angus Ndirpaya Jr. avatar Bra0xit avatar Artem Vorobev avatar Pranav Reddy Lakkadi avatar Abhishek Alimchandani avatar nuthan2x avatar 0xSolus avatar Ishaq Nasir avatar  avatar yashvik avatar  avatar  avatar  avatar  avatar

Forkers

noorahsmith

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.