0

The Scam: Put 20 USDT in an account, give someone the private key (or seed phrase.) When they transfer gas in, immediately transfer it out to your wallet. I assume there is a bot running to make the transfer. The ETH is usually transferred out within a few blocks.

My Scam of the Scam: Send gas to the account, send the USDT to my account really fast. Like the same block fast.

Can I package two transactions together to beat the scammers bot? Is it possible? Would it work?

NOTE: I would love to use golang go-ethereum or python web3.py or javascript web3.js to make the transactions

NOTE: I know how to make multiple transactions with the above tools, I just want to know if it would successfully scam the scammer.

1 Answer 1

0

Normally if you want two transactions to execute sequentially in quick proximity, you could publish them both to the mempool at the same time with sequential nonces. The miners would then include them in nonce order, possibly in the same block.

The confounding factor here is that the transactions you want to be sequential aren't coming from the same account, and the second transaction is not executable until the first transaction completes, so it won't be accepted into the mempool since it's not executable until the first transaction completes.

Now, you might have some luck using an intermediate contract. The scammer is likely watching the mempool for funding transactions, and acting quickly as those transactions confirm. If you sent your transaction to a contract and the contract forwarded funds to the address in question, they're probably not going to identify the transaction until it hits their account, in which case you might have a little bit more time to get your transaction out and confirmed.

But keep in mind that the scammer can afford higher gas fees than you can, since they're trying to send whatever ETH is leftover after fees while you're trying to do a more gas-intensive contract transaction. Whatever gas price you can offer given the balance of the account, they can outbid so the miner will include their transaction instead.

Ultimately, your best bet is probably to get a miner to help you. For that, I'd recommend looking into Flashbots. You can assemble a transaction bundle with three transactions.

Transaction 1: Sends ETH to the scam address. This transaction should include 0 priority miner fee, so the miner has no incentive to include it without the rest of the bundle. Transaction 2: Sends tokens to the destination address. Again, use a 0 priority miner fee so the miner won't include this without the whole bundle. Transaction 3: Call a smart contract that confirms transaction 2 completed successfully, then sends ETH to the block.coinbase address for miner fees. Again, use a 0 priority miner fee so that the miner can't get paid unless the contract executes successfully.

This ensures that a miner has incentive to include all three transactions or none of the transactions, because the only get paid if all three transactions execute successfully. The only risk here is if the miner who picks up your transaction bundle is the scammer, as they could take your transaction 1 then sign their own version of transaction 2 to take your funds. The odds of that are pretty small though, as even if the scammer is an acting miner it's unlikely they'd get the next block after you sent this bundle.

2
  • Good answer. Doesn't the fact that the transaction is usually blocks later make it seem like they are running a GetBalance call? How would running an intermediate contract work? I don't have any ETH on Ethereum right now, how much would you estimate the flashbots bundle costing?
    – mteam88
    Commented Sep 14, 2022 at 16:31
  • They probably have a GetBalance call as a backup, but my guess is they're watching the transaction to optimize response times. The intermediate contract could essentially be a contract where the constructor calls require(USDTToken.balanceOf(target) > someValue) then selfdestruct(block.coinbase) to send the balance you sent the constructor to the miner. Costwise, you shouldn't have to pay the miner much more than you would sending the three transactions independently. With current gas prices, it should be less than the $20 in your hypothetical.
    – AusIV
    Commented Sep 14, 2022 at 19:10

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.