慢雾:Polkatrain 薅羊毛事故简析
链捕手消息,波卡生态 IDO 平台 Polkatrain 于今早发生事故,慢雾安全团队第一时间介入分析,并定位到了具体问题,接下来以快讯的形式分享给大家,供大家参考分析。
本次出现问题的合约为 Polkatrain 项目的 POLT_LBP 合约,该合约有一个 swap 函数,并存在一个返佣机制,当用户通过 swap 函数购买 PLOT 代币的时候获得一定量的返佣,该笔返佣会通过合约里的 _update 函数调用transferFrom 的形式转发送给用户。由于 _update 函数没有设置一个池子的最多的返佣数量,也未在返佣的时候判断总返佣金是否用完了,导致恶意的套利者可通过不断调用 swap 函数进行代币兑换来薅取合约的返佣奖励。
慢雾安全团队提醒 DApp 项目方在设计 AMM 兑换机制的时候需充分考虑项目的业务场景及其经济模型,防止意外情况发生。
Related tags
ChainCatcher reminds readers to view blockchain rationally, enhance risk awareness, and be cautious of various virtual token issuances and speculations. All content on this site is solely market information or related party opinions, and does not constitute any form of investment advice. If you find sensitive information in the content, please click "Report", and we will handle it promptly.
Related tags