xdefilab / xhalflife-base

xDeFi Exponentially or Linear Decaying Money Stream Protocol
https://xhalflife.xdefi.com
GNU General Public License v3.0
10 stars 4 forks source link

疑问:销毁流动性时,应该销毁剩余的部分吧 #15

Closed niuniu-afk closed 3 years ago

niuniu-afk commented 3 years ago

image 退出费用不为0,那么需要将流动性的一部分(手续费)转出 此时再销毁时,应该销毁扣除流动性之后的部分吧,否则销毁失败

xdefilab commented 3 years ago

背景补充:

  1. 判断官方矿池的标准(建池的tx.origin == XConfig.getFarmCreator(),由该地址建的池为官方矿池 )
  2. 官方矿池收1%的exitFee;
  3. 用户调用Proxy建池的话,无法自定义exitFee(默认是0);当用户自行调用Factory和Pool建池的话,可以自定义exitFee(最大不超过MaxExitFee);
  4. 如果exitFee大于0,在用户退出时,将这部分费用发给tx.origin而不是pool.controller(因为controller可能是个合约)

截图这里确认是bug,因为burn的量多了,应该burn(poolAmountIn.sub(exitFee))

xdefilab commented 3 years ago

https://github.com/xdefilab/xdefi-base/pull/9