VIVAToken Rug Pull
What happened
VIVAToken was a BNB Chain yield farm whose MasterChef contract, deployed on 14 July 2021 at 0xD9D4467F…9f06e1, took LP-token deposits and paid rewards in VIVA. Next to the usual deposit and withdraw code it has an owner-only updateMasterchef function, commented as a V2 migration, that sends the contract's entire balance of any listed token, including every user's staked LP tokens, to an address the owner chooses. Nothing in the function records who owned those tokens, so after it runs the farm still shows each user's stake but holds nothing to pay it back.
The deployer 0x2AC11a63…abC0Cd still holds ownership. De.Fi's REKT database lists VIVA as an exit scam/rug pull; no loss figure was found.
How it happened
- Users call
deposit, which pulls LP tokens into the farm withpool.lpToken.safeTransferFrom(address(msg.sender), address(this), _amount)and records the stake inuser.amount. - The owner calls
updateMasterchef(maincontract, router)with the LP token addresses inmaincontractand any destination inrouter. - For each token the function reads
tokenObj.balanceOf(address(this))and runstokenObj.transfer(router, tokenAmt), moving the farm's whole balance, staked LP included, to that address. userInfois not changed, sowithdrawandemergencyWithdrawtry to send each user's recordeduser.amountfrom a zero balance and revert; the LP tokens can then be redeemed for the pool's underlying tokens by whoever received them.- The owner can also raise
VIVAPerBlockwithout limit throughupdateEmissionRate; every reward update mints another 10% of the pool reward to the two dev addresses (750and250basis points).
Protocol details
Evidence
- transaction VIVAToken MasterChef contract creation transaction bscscan.com
- address BscScan address page for 0xD9D4467F115EFFAA0dd3af9749768eBb5D9f06e1 (De.Fi proof link) bscscan.com
- address VIVAToken MasterChef verified contract code on BscScan bscscan.com
- analysis Sourcify match for 0xD9D4467F115EFFAA0dd3af9749768eBb5D9f06e1 on BNB Chain repo.sourcify.dev
Build your security review skills
Work through hands-on labs covering real exploit mechanics, review techniques, and defensive patterns.