3

This is the first time I've used this contract. I liked it because there is no enable/disable trading function, fee limits, and dynamic liquidity fee structure. Anyways, now that the token has served its purpose and the liquidity lock has expired, I realized when I went to remove the liquidity that the contract is no longer tradable.

I have tried enabling/disabling SwapBack with varying values, I've tried setting TargetLiquidity to 0, 10, 25, 100, and of course I've tried setting fees to 0 and max transaction/wallet to 100% of supply.

0x78A33B62bA0c86b38be6FDe23C28b208aEA60bF1

Worse yet, before I realized there was an issue with this contract, I had already planned & filled a presale (that I KYC'd for) using the same contract..

Unsurprisingly, the same thing happened.

Here's the second contract: 0xfea5377af47742ada0b1d4d5528ed1d2368d148b

I'm offering a 10BNB reward for anyone who can figure out what the issue is.

4
  • Also, this is a BSC contract, and I've also tried sending tokens & BNB to the contract address (in case it was due to a clogged router). Commented Jan 31, 2022 at 8:07
  • Ok, so you used this contract for the first time? So you never actually traded anything over it before? (And as far as I can see it hasn't been audited. So I have to ask, where did you find this contract in the first place?
    – Sky
    Commented Jan 31, 2022 at 8:46
  • Actually it is audited. github.com/coinscope-co/audits/blob/main/metavs/audit.pdf Commented Jan 31, 2022 at 10:40
  • Hi, I can help. Please tell me what function you are trying to call? Or are you just trying to remove liquidity via a dex? Commented Jan 31, 2022 at 11:31

1 Answer 1

1

I figured out the issue:

The token tax is structured to lower marketing & buyback fees over the first ten days of launch, but I overlooked the fact that there is no lower limit for the calculation.

If you'd like to look at the hard code where this is happening, it begins on line 335 of the contract.

uint256 days_since_start = (block.timestamp - launchedAt) / 1 days;

if(days_since_start > 0 &&

days_since_start < 10) {

_sellLiquidityFee = _initialSellLiquidityFee;

_sellBuybackFee = _initialSellBuybackFee - days_since_start;

_sellMarketingFee = _initialSellMarketingFee - days_since_start;

_sellTotalFee = _sellMarketingFee + _sellLiquidityFee + _sellBuybackFee;

Essentially what this function is doing is calculating the number of days since launch, and subtracting that number as a percent from the marketing/buyback tax, from day 1 to day 10. After day 10, this is no longer applicable and the initial fees are restored.

The issue is that I set the marketing tax to 5% and buyback to 3%, so on day 4 of launch, the contract is calculating a buyback tax of negative 1%. This obviously isn't possible, which is why the contract isn't able to function correctly.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.