wise-token-contracts
wise-token-contracts copied to clipboard
question?
I saw in Snapshot.sol file, which the variable onUniswap.mul(200).div(totalSupply()) calculates double liquidation of wise token, can't we simplified to onUniswap.mul(100).div(totalSupply()) and compare with ratio< 30 or ratio>20 instead? Are there any other caluclations involved so that we must go for the first approach?
function liquidityGuardTrigger() public {
(
uint112 reserveA,
uint112 reserveB,
uint32 blockTimestampLast
) = UNISWAP_PAIR.getReserves();
emit UniswapReserves(
reserveA,
reserveB,
blockTimestampLast
);
uint256 onUniswap = UNISWAP_PAIR.token1() == WETH
? reserveA
: reserveB;
uint256 ratio = totalSupply() == 0
? 0
: onUniswap
.mul(200)
.div(totalSupply());
if (ratio < 40 && isLiquidityGuardActive == false) enableLiquidityGuard();
if (ratio > 60 && isLiquidityGuardActive == true) disableLiquidityGuard();
emit LiquidityGuardStatus(
isLiquidityGuardActive
);
}
@coffee-converter can tell you more why this decision was made to double the bar
@dulumao please mark such things accordingly as question
and not a bug
if you are just questioning. Thanks!
@vm06007 ok