Skip to content

GregoryUnderscore/MEV-Resistant-ERC20-SB

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

** MEV Resistant ERC20 (Same Block Solution) **

Summary

Everyone hates sandwich attacks, except for those attacking. This ERC20 contract discourages them by preventing a buy and sell in the same block. A person/bot will be unable to sell their coins unless they wait 1 block (typically 10-15 seconds on Ethereum).

Description

Since sandwich attacks are greatly reliant on speedy execution, the "same block restriction" may discourage them altogether. By the time the attacker can sell, their profit may have completely disappeared.

For details, see MEVResistantERC20.sol, specifically the _beforeTokenTransfer and _afterTokenTransfer functions.

An alternative and likely more robust solution utilizing longer cooldown times can be found here: https://github.com/GregoryUnderscore/MEV-Resistant-ERC20

Forked from $APE.

Original Smart Contract: https://etherscan.io/address/0x4d224452801aced8b2f0aebe155379bb5d594381#code#F5#L1

How to Use

  1. Fork the code.
  2. Add appropriate whitelists (i.e. Uniswap etc.) via the addTimeRestrictionWhitelist function (only the contract owner can do this).

About

This is an ERC20 implementation that discourages sandwich attacks (MEV) by preventing buys/sells in the same block. There is a whitelist for Uniswap etc., allowing important contracts to bypass the restriction. The contract owner sets the whitelist as needed.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors