xWin Finance 攻击学习

合约地址:
xWinDefi:https://bscscan.com/address/0x1bf7fe7568211ecff68b6bc7ccad31ecd8fe8092#code
xWinFarm:https://bscscan.com/address/0x8f52e0c41164169818c1fb04b263fdc7c1e56088#code
攻击交易:https://bscscan.com/tx/0xba0fa8c150b2408eec9bbbbfe63f9ca63e99f3ff53ac46ee08d691883ac05c1d
学习文章:
xWin攻击事件复盘分析:https://www.anquanke.com/post/id/245858
SharkTeam独家分析 | xWin Finance闪电贷攻击事件分析:https://www.tuoniaox.com/news/p-506470.html


攻击者通过借贷后通过Subscribe 将大量bnb加入bnb-xwin池中, 并通过拿到的(根据加入池中的lp)xwin交易回原本的bnb,最后通过邀请奖励机制,

 function _updateReferralReward(xWinLib.TradeParams memory _tradeParams, address _managerAddress) internal {
    
    
      .......
        xWinLib.xWinReward storage _xwinReward =  xWinRewards[_xWinReferral.referral];
        if(_xwinReward.accBasetoken > 0){
    
    
            uint256 entitleAmt = _tradeParams.amount.mul(referralperunit).div(1e18);  //0.10
            _xwinReward.previousRealizedQty = _xwinReward.previousRealizedQty.add(entitleAmt);
        } 
  .......
    }

将邀请奖励池xWinDefi中大量代币带走并卖出。

猜你喜欢

转载自blog.csdn.net/Timmbe/article/details/123388640