GithubHelp home page GithubHelp logo

orlando-rescue's Introduction

flashbots rescue

technical details

compromised account: 0xfcF4710e3078c3b28dcCc90adf3a1faFf6dD3a7A

ETH

Recoverable assets: aWETH, (aave) VariableDebtUSDC, DUCK.

Transfer Only

These assets can simply be transferred out.

Unstake & Transfer

This asset has to be un-staked as well as transferred.

7.775 DUCK can be transferred out directly. 2000 are still locked in a staking contract (Duckstarter).

Call withdraw(amount) on Duckstarter, then transfer total DUCK balance from account. Calculate pre-transfer balances in hardhat simulation.

BSC

These assets must be un-staked and transferred.

Recoverable assets: CAKE, BUNNY, WISE.

Bunny is a lending/staking platform. victim earns CAKE & BUNNY by depositing CAKE. CAKE/BUNNY Pool

It looks like by exiting from the CAKE staking contract, we will receive both CAKE & BUNNY tokens.

The website shows two buttons: "Withdraw" and "Exit: Claim & Withdraw". We want the latter. withdrawAll seems like the right function...? Aforementioned contract address is a proxy. Here's the base contract

relevant methods to investigate: getReward, harvest, withdraw, withdrawUnderlying, withdrawAll

withdrawAll does two (relevant) things: CAKE.safeTransfer (transfers CAKE), and _harvest(cakeHarvested). The functionality of the former is obvious, but what does _harvest do? getReward does the same but it only claims the reward amount; doesn't transfer out everything.

_harvest does this:

    CAKE_MASTER_CHEF.enterStaking(cakeAmount);

... which, in the CAKE_MASTER_CHEF contract, does this:

    pool.lpToken.safeTransferFrom(address(msg.sender), address(this), _amount);

... it transfers LP tokens from sender to contract. Why is this called?

Fuggit let's just run a sim in hardhat and see what happens.

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.