Beets Farm Rug Pull

Reported loss Not disclosed
Polygon
Rugpull

What happened

Beets Farm (BeetsFarm Finance) was a Polygon yield farm whose MasterChef, deployed on 14 June 2021 at 0x56961056…8E97c7 by 0x369CaBe5…aC1a1A, paid rewards in BeetCoin (BEET). Its deposit and emergencyWithdraw functions take a _wallet argument instead of using the caller, so anyone can pull tokens from any address that approved the farm, and emergencyWithdraw sends a user's whole stake to the admin wallet rather than back to the user. Reports published on 18 June 2021, crediting RugDoc's analysis, say the operators forced approved accounts to deposit their remaining tokens and then emergency-withdrew everything to their own wallet.

The Quadriga Initiative puts the loss at about $146,000 across 289 users; another report gives more than $100,000. The contract source was not verified on the explorer at the time of the rug.

How it happened

  1. The constructor stores wallet and feeWallet; both were set to the deployer 0x369CaBe5…aC1a1A. Only the current wallet can change it (require(msg.sender == wallet, "dev: wut?")).
  2. deposit(uint256 _pid, uint256 _amount, address _wallet) has no check that msg.sender is _wallet, and pulls the tokens with pool.lpToken.safeTransferFrom(address(_wallet), address(this), _amount). Anyone can therefore move tokens into the farm from any address that has approved the MasterChef, up to the approved amount.
  3. getAllHolders lists every address that ever deposited into a pool, which gives a ready list of targets.
  4. emergencyWithdraw(uint256 _pid, address _wallet) is also callable by anyone for any user. It zeroes the user's stake and runs pool.lpToken.safeTransfer(address(wallet), amount), so the tokens go to the admin wallet, not to the user.
  5. According to the June 2021 reports, the operators combined steps 2 and 4: they forced approved accounts to deposit their remaining tokens and then emergency-withdrew all stakes to the admin wallet.

Protocol details

Classification Token
Protocol Type Exit Scam/Rugpull
Affected asset / contract Beets
Protocol links Website

Build your security review skills

Work through hands-on labs covering real exploit mechanics, review techniques, and defensive patterns.