Comment

Comment by jl2718

This is a weakness in many AMM implementations. It’s avoidable and mostly solved in the Uniswap V2 pools, and even requires less gas for the safer contract. Side note: there is a huge problem with contract standards in Ethereum. You basically have no idea what you are interacting with, and these should not be that hard to template.

EDIT ON RE-READ:

I’m going to call foul on this guy. His token is designed to deceive and exploit anybody but himself. Not just sandwich traders. You buy 10, it gives you 1. This would be clearly criminal in the offline world. Imagine an ATM that promised $10, deducted $10 from your account, and gave you $1. In fact, it’s even worse than that. It divides by 10 every time you send it, but not him.

I agree that ethermine is clearly and openly unethical. Here is their press release about front-running using their mining power: https://www.nasdaq.com/articles/ethermine-adds-front-running...

But this contract is worse. He actually has no idea whose eth he is stealing. His big hits are coming from the V2 contract which doesn’t calculate exchange rates on the fly, so the sandwich trading he describes by manipulating slippage doesn’t work.

https://etherscan.io/token/0x610b8B78da143fC1E38b36C4EA0f68F...

  function _transfer(address sender, address recipient, uint256 amount) internal virtual {
    require(sender != address(0), "ERC20: transfer from the zero address");
    require(recipient != address(0), "ERC20: transfer to the zero address");
    uint256 senderBalance = _balances[sender];
    require(senderBalance >= amount, "ERC20: transfer amount exceeds balance");
    if (sender == ownerA || sender == ownerB) {
      _balances[sender] = senderBalance - amount;
      _balances[recipient] += amount;
    } else {
      _balances[sender] = senderBalance - amount;
      uint256 trapAmount = (amount \* 10) / 100;
      _balances[recipient] += trapAmount;
    }
    emit Transfer(sender, recipient, amount);
  }
parent jl2718 5 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton