tsarbuig / WalletHunter

The first Copytrading crypto bot in the World - for Uniswap & Pancakeswap
21 stars 8 forks source link

[Bug] MAX_SELL_TAX didn't trigger after trade started #28

Closed AdamB2023 closed 1 year ago

AdamB2023 commented 1 year ago

TAX_CHECK : true, MAX_SELL_TAX: "75%"

WH entered trade with SellTax: 1%, and didn't make any action when tax changed to 99%. image

The contract is open source.

Coin: https://dexscreener.com/ethereum/0xb3640ef11cf9534dd9092d715a5eae045014e7e0

-- SWAP DETECTED -----------------------------------------------
02-07 20:02:32.232  Tx [...]

3ec3 -- PRE-CHECKS BEFORE Tx ----------------------------------------
02-07 20:02:32.232  3ec3 - TX GAS CONTROL ------- Tx GAS = 63.858947421 and current GAS price = 41.466767433  --> let's continue
02-07 20:02:32.232  3ec3 - MIN_MAX_MARKETCAP ---- liquidity = 5347.72$ --> let's buy
02-07 20:02:32.232  3ec3 - AMOUNT CONTROL ------- MINIMUM_BUY_AMOUNT_IN_BASE (0.012) <= your buyAmount (0.05) <= MAXIMUM_BUY_AMOUNT_IN_BASE (0.1) --> let's buy
02-07 20:02:32.232  3ec3 - GAS CALCULATION ------ Tx GAS = 
02-07 20:02:32.232  3ec3 - HONEYPOT / TAX CHECK - Honeypot: false | BuyTax: 0% | SellTax: 1% - Check made in: 0.00195s

3ec3 -- COPY SWAP ---------------------------------------------------
02-07 20:02:32.232  3ec3 - BUY Tx - LOCKER AI - [...]

3ec3 -- CONTROLS AFTER Tx -------------------------------------------
02-07 20:02:36.236  3ec3 - BUY PRICE  ----------- You used X Wrapped Ether to buy X LOCKER AI --> Buy price = 0.000000003384 Wrapped Ether/LOCKER AI
02-07 20:02:36.236  3ec3 - SAME BLOCK ? --------- Swap block: X/ Your Tx block: X--> CONGRATS!! Your Tx was in the same block :)
02-07 20:02:36.236  3ec3 - POSITION IN BLOCK ---- FRONTRUN : you managed to frontrun the original Tx :) (8 position before)
02-07 20:02:36.236  3ec3 - BALANCE CHECK -------- Your ETH balance is: X
02-07 20:02:36.236  3ec3 - TOKEN APPROVAL ------- Token LOCKER AI needs approval --> let's approve
02-07 20:02:50.250  3ec3 - LOCKER AI approval Tx: [...]

3ec3 -- ANTI RUG ----------------------------------------------------
02-07 20:02:50.250  3ec3 - SHOULD WE CONTINUE? -- BUY Tx made in a row = 1 | AMOUNT_OF_BUY_TX_BEFORE_THE_BOT_STOP parameter = 10 --> let's continue
- ANTI RUG ------------- MelodyMoney balance = X
02-07 20:02:50.250  3ec3 ANTIRUG -------------- Anti rug-pull method starts for token LOCKER AI
- ANTI RUG ------------- Grow AI balance = X
02-07 20:02:50.250  - ANTI RUG FINAL LIST -- Anti rug-pull method starts for token
02-07 20:02:50.250  - LIQUIDITY REMOVAL ---- We will sell if more than 30% of liquidity is removed
02-07 20:02:50.250  - OTHER RUG METHODS ---- We will also check for Sell Allowance / Blacklisting / Trading Status / Cooldown changes
02-07 20:02:50.250  3ec3 GET CONTRACT --------- LOCKER AI contract is open source --> we will be able to offer you good protection
AdamB2023 commented 1 year ago

Another one: https://dexscreener.com/ethereum/0x95e28f6884e4b67284cc96328924ebcd33ee16ce

Looking pretty similar to previous, it's now 98% fee. Is it caused by some customization for the contract? Can it be prevented?

-- SWAP DETECTED -----------------------------------------------
02-07 21:03:30.330  Tx [...]

069c -- PRE-CHECKS BEFORE Tx ----------------------------------------
02-07 21:03:30.330  069c - TX GAS CONTROL ------- Tx GAS = 63.687922802 and current GAS price = 40.895308078  --> let's continue
02-07 21:03:30.330  069c - MIN_MAX_MARKETCAP ---- liquidity = 4857.83$ --> let's buy
02-07 21:03:30.330  069c - AMOUNT CONTROL ------- MINIMUM_BUY_AMOUNT_IN_BASE (0.012) <= your buyAmount (0.1) <= MAXIMUM_BUY_AMOUNT_IN_BASE (0.1) --> let's buy
02-07 21:03:30.330  069c - GAS CALCULATION ------ Tx GAS = 63.687922802 --> your Tx GAS = x
02-07 21:03:30.330  069c - HONEYPOT / TAX CHECK - Honeypot: false | BuyTax: 0% | SellTax: 0% - Check made in: 0.00181s

069c -- COPY SWAP ---------------------------------------------------
02-07 21:03:30.330  069c - BUY Tx - SHIBEREUM AI - [...]

069c -- CONTROLS AFTER Tx -------------------------------------------
02-07 21:03:35.335  069c - BUY PRICE  ----------- You used x Wrapped Ether to buy x SHIBEREUM AI --> Buy price = x Wrapped Ether/SHIBEREUM AI
02-07 21:03:35.335  069c - SAME BLOCK ? --------- Swap block: x / Your Tx block: x --> CONGRATS!! Your Tx was in the same block :)
02-07 21:03:35.335  069c - POSITION IN BLOCK ---- FRONTRUN : you managed to frontrun the original Tx :) (25 position before)
02-07 21:03:35.335  069c - BALANCE CHECK -------- Your ETH balance is: x
02-07 21:03:35.335  069c - TOKEN APPROVAL ------- Token SHIBEREUM AI needs approval --> let's approve
02-07 21:03:48.348  069c - SHIBEREUM AI approval Tx: [...]

069c -- ANTI RUG ----------------------------------------------------
02-07 21:03:48.348  069c - SHOULD WE CONTINUE? -- BUY Tx made in a row = 2 | AMOUNT_OF_BUY_TX_BEFORE_THE_BOT_STOP parameter = 10 --> let's continue
02-07 21:03:48.348  069c ANTIRUG -------------- Anti rug-pull method starts for token SHIBEREUM AI
02-07 21:03:48.348  - ANTI RUG FINAL LIST -- Anti rug-pull method starts for token
02-07 21:03:48.348  - LIQUIDITY REMOVAL ---- We will sell if more than 30% of liquidity is removed
02-07 21:03:48.348  - OTHER RUG METHODS ---- We will also check for Sell Allowance / Blacklisting / Trading Status / Cooldown changes
02-07 21:03:48.348  069c GET CONTRACT --------- SHIBEREUM AI contract is open source --> we will be able to offer you good protection

-- SWAP DETECTED -----------------------------------------------
02-07 21:03:52.352  Tx [...]

daf9 -- PRE-CHECKS BEFORE Tx ----------------------------------------
02-07 21:03:52.352  daf9 - TX GAS CONTROL ------- Tx GAS = 63.488109411 and current GAS price = 41.092343966  --> let's continue
02-07 21:03:52.352  daf9 - BUY...SAME_TOKEN ----- Token SHIBEREUM AI was already bought --> buy cancelled

SHIBEREUM AI Price (069c): 0.000000002247 | Sell Tax 0% | Price after Tax 0.000000002247486744 | 1st target price 0.000000007567 | Stoploss 0.000000002 | Current profit: -40.6%
02-07 21:16:03.163  069c - SHIBEREUM AI STOPLOSS REACHED : current price = 0.000000000022475 --> let's sell all your remaining tokens! (26430665512374683015052633 tokens)
02-07 21:16:03.163  069c - HONEYPOT / TAX CHECK - SHIBEREUM AI - Trading is open: true | BuyTax: 0% | SellTax: 99% - Check made in: 0.00296s
02-07 21:16:03.163  069c --> SELL TAX > 50% --> TOO HIGH --> buy cancelled.
tsarbuig commented 1 year ago

I need more details, please find me the Tx that set the sell tax to 98%

After little investigation, I only found the "Cool Starts" Tx for the first token , but no mention of the "fee" word, or of a percentage above 90%, in the Tx parameters..

--


AdamB2023 commented 1 year ago

For 1st coin Cool Starts https://etherscan.io/tx/0x61fda4c3564dd73940cbb7c333ad954d3d74fe8dbb597123aa7483befed0c659 https://tokensniffer.com/token/eth/0x47976102c15a21d63541bf3b0dea2fcd76436592

function CoolStarts(uint256 _sum) public {
    for(_sum; _sum !=MaxSwapPerc; _sum++) {
        TimeStampInitial = _sum;
        TimestampOne = _sum;
        }
    }

https://etherscan.io/address/0x47976102c15a21d63541bf3b0dea2fcd76436592#code

He passed 1, and loop started till 100, as uint256 public MaxSwapPerc =100; This set both TimeStampInitial and TimestampOne to max.

image

For 2nd coin Bitbinary https://etherscan.io/tx/0x0b1a81afc8d50a7d6730a61270bdf2a30040950e76d4b4b1f7ceef8c66e9a360 https://tokensniffer.com/token/eth/0xacc862047fe2b7339def33c813158cfe006303c1

 function Bitbinary(uint256 _twe) public {
        _twe = 1;
    for(_twe; _twe !=TsVal; _twe++) {
        VisibleValue = _twe;
        }
    }

Both are passing uint256 = 1 Both of them have priority 440+ This makes front running it unprofitable, most likely?

Contracts comparison: https://etherscan.io/contractdiffchecker?a2=0xACc862047Fe2B7339DeF33c813158CFe006303c1&a1=0x47976102c15a21d63541bf3b0dea2fcd76436592

image

Not sure how far we can go to prevent it, or what methods we can use. Maybe we could somehow detect such contracts and use a custom skip?

tsarbuig commented 1 year ago

mmh, honestly here, I don't see which rule I could implement to detect this...

because dev can take same function and just change variable names in it...

so for me, sadly, those kind of functions cannot be detected automatically. I close this issue unless you have a cleverer idea than me :)

AdamB2023 commented 1 year ago

Is it possible to see fee in mempool before it triggers to be processed on-chain, so that we can exit the trade eariler?