It was a bad night for #BSC #defi, but I wanted to share a tip. If you ever need to quickly get your staked LP liquidity tokens from a rug-pulled project like $SAFU, the Contract explorer on @bscscan can be your lifeline.

Let's review!
Most of these #defi projects use boilerplate from SushiSwap, so first thing is to locate the project's MasterChef Contract. You should know this address before staking in any new project, and devs should publish!

For our example, #SAFUSwap's Contract is https://bscscan.com/address/0x1C9F2AEB888de01C3fa8e2D7485a7f281FBc779a
The Contract tab on BSCScan will allow you to interact with the contract that handles token pairs and rewards. You can read the Code (always a good idea), but what we really want to do is Read and Write.
Since most projects offer several liquidity pairs, you will need to do a little bit of digging to determine which pool ID (or 'pid').

To do this, you'll want to switch to the 'Read Contract' section, and scroll down to the functions that deal with the pool details.
First, we find the number of pools. Under 'poolLength', you see there are 8 pools (which will be referred to from 0 - 7).

You could get the PoolInfo from each one and match them to the LP Contract, but I think just mapping out which pids return values from Pending is fine.
Now that you know which pool(s) have your LP tokens, let's get them back! At the top of the section, switch to 'Write Contract', and authorize your wallet with "Connect to Web3".

This process should look familiar, as you're simply allowing the page to interact with your wallet.
The function you're looking for is 'emergencyWithdraw'. You will lose any staking rewards this way, but in a rugpulled project, they'll be worthless.

For each pid that you recorded, enter it and click 'Write' to tell the contract to return your LPs, which can then be liquidated.
If you want to try pulling the LPs *and* the associated rewards, you can try using the 'withdraw' function, giving the exact amount from the pending call; but when you're scrambling to recover what you can, may not be as prudent.

Best of luck to everyone in the #BSC #defi space!
You can follow @DefiDebauchery.
Tip: mention @twtextapp on a Twitter thread with the keyword “unroll” to get a link to it.

Latest Threads Unrolled: