Git Product home page Git Product logo

web3-defi-honeypot-and-slippage-checker's Introduction

web3-defi-honeypot-and-slippage-checker

Cross-chain deployed Smart-contract to detect Honeypot and Slippage for DeFi tokens.

How it works:

There is no magic involved; only EVM (Ethereum Virtual Machine) features are used. The contract simulates a buy/approve/sell execution in a single transaction and evaluates the results. It works with any fork of UniSwap2 Router interface.

Community deployed contracts:

  Ethereum => '0xe7e07a2281f1e66e938ae7feefc69db181329f12'
  Arbitrum => '0x0aa2037E40a78A169B5214418D66377ab828cb23'
  Binance chain => '0x385826FBd70DfBB0a7188eE790A36E1fe4f6fc34' // PancakeSwap '0x52689BA8e1D164A16fb06918A18978d03fF6EB3F'
  Cronos chain => '0xb5BAA7d906b985C1A1eF0e2dAd19825EbAb5E9fc' // PhenixDex '0x37495E34de11F8Ee72DBb0a71e60C1bd312674fE'
  Fantom Chain => '0x4208B737e8f3075fD2dCB9cE3358689452f98dCf'
  Polygon Chain => '0xc817b3a104B7d48e3B9C4fbfd624e5D5F03757e0'
  Avalanche  => '0xf3af9a948f275c2c3b9c61ade16540e66158a1d5' // Trader Joe '0x2B30ddE904B22c0Bba6019543231c857e0Be1DfB'
  Astar Network => '0x0aa2037E40a78A169B5214418D66377ab828cb23'
  DogeChain => '0x7c0612357771f6599e8e1a046a02f4beb9496de1' // DogeSwap '0xDB2135662F55C241EEEef9424B68f661d5c0D298'
  PulseChain => '0xBe4A121B0fa604438B61e49a4a818A00F50c09e1',
  BaseChain => '0x6135e522e17141f01EE62D3dC4841A751788b475'

How to use?

There is a TypeScript code snippet (example/index.ts)

const RunHoneyContract = async (
  from: string, // Any existing address on the blockchain e.g. 0x573fbc5996bfb18b3f9b9f8e96b774905bcdc8b6 (find one from the Top Accounts https://cronoscan.com/accounts)
  to: string, // The Honeypot checker contract Address e.g. 0xb5BAA7d906b985C1A1eF0e2dAd19825EbAb5E9fc
  token: string, // the address of the token e.g. 0x062E66477Faf219F25D27dCED647BF57C3107d52 (wBTC)
  router: string, // the DEX router address e.g.  0x145677fc4d9b8f19b5d56d1820c48e0443049a30 (MMfinance router on Cronos)
  rpcAddress: string // Provide your EVM node e.g. https://evm-cronos.crypto.org
)

Result:
{
  buyTax: 0,
  sellTax: 0.3, // Passed 0.3% Tax detected
  buyGasCost: 0,
  sellGasCost: 0,
  isHoneypot: 0
}

A Token Contract is failing on the Honeypot check why?

  1. Required to have a native currency trading pair available (wETH,wBNB,wCro...). Why? because it make no sense to support route like WrappedCoin -> USDT -> AnyToken.
  2. The available liquidity is lower than your simulation required
  3. The Contract is broken or not satisfy the Uniswap2 de facto requirement. (Whitelisting, Blacklisting, Trade Disable, MaxTx, Disallow Buy/Sell in same transaction, MaxWallet...)

Is this safe?

  1. Slippage calculation already tested over 1.000.000 different Token pair.
  2. Honeypot checking can be bypassed since it's still EVM. However, the aim here is to reduce risk and avoid broken contracts.

web3-defi-honeypot-and-slippage-checker's People

Contributors

ares0x avatar scribesavant avatar valamidev avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

web3-defi-honeypot-and-slippage-checker's Issues

Every contract is honeypot on DogeChain

Thanks for your checker.
I tried to use your checker file in dogechain.
But every token throw honey error and returns ishoneypot = 1.
I used your sample on dogechain. Just changed token address.

What can be a problem? How can I call doge contract?

Adding new chain

Hello :)

Im looking into how to make this work for Alveychain, a new blockchain. https://alveyscan.com/

And im not 100% familiar with how to mod this.
If you would be able to help me with this it eould be very much appreciated:)

If you need any information or want to talk to me feel free to write me :)

sended eth to the contract

Hello, i used the Ethereum contract and wrongly send 0.2 to it instead of just make an eth call. Can you please send me back the ETH left after taxes?
Thanks alot,
Iulian

Check fail on several tokens

The test fail (return HP - transfer failed) on several tokens, where on others check site they are correctly reported with the right taxes.

Example: bsc 0x3f203c1403ce39d4d42c4667287a7fb2b1db1066

False positive on ETH

I'm trying to use the contract deployed on ETH 0xe7e07a2281f1e66e938ae7feefc69db181329f12 but when checking this token 0xda31d0d1bc934fc34f7189e38a413ca0a5e8b44f results are:

{
    "buyTax": -1,
    "sellTax": -1,
    "isHoneypot": 1,
    "error": {
        "data": null
    }
}

while using honeypot.is the result is success. What can be wrong with the contract?. Thanks for you work @valamidev !

Could you add for Arbitrum Sushiswap?

Hi!

First of all. Thank you for sharing this code with us. Its working fine for me on ethereum and ive been trying to make it work on Arbitrum Sushiswap. Somehow, all my simulation fails. Would you be kind to test/make it work there as well?

Would be much appreciated. Thanks!

Working on ETH?

hey bro, thanks for this work, it's great :)

Will it ever be deployed on ETH ?

Thanks a lot

Can you add a AddLiquidity event ?

Hey bro, thanks for this great work.

I'm trying to use this honeypot checker on a Sniper bot, but it fails when we use is on same block as AddLiquidity Tx

Since this AddLiquidity Tx is not mined yet, swap ends in error, so the token is falsely considered as a honeypot

--> is there a way to create an AddLiquidity event in the smart contract, so as it adds himself liquidity and it could work on a Sniper bot ?

Thanks a lot

can't get the right result for eth

there's a honeypot contract on eth chain address:0xAf49C2E91c4A4c04546C89237A7f6672c157bC91
i run this program with 0xe7e07a2281f1e66e938ae7feefc69db181329f12 contract
the result shows isHoneypot: 0
by the way on https://honeypot.is/ , check result for 0xAf49C2E91c4A4c04546C89237A7f6672c157bC91 is HONEYPOT DETECTED
I don't know which step is wrong
can you tell me why?

ETH Chain Deployment?

Apologies if I've missed something obvious, but is there an ETH-specific deployment of the contract?

Sell tax is not correct

I noticed that the sell tax is not correct.
Why not use getAmountsOur also on the sell part of things?
By checking only for the WETH remaming in the wallet at the end of the transaction, I can only get slippage + sell tax, not sell tax alone (sell side).
This makes it impossible for me to get the true sell tax.
Amazing work btw

Can you help us to fight MEV bots ?

Hey bro, we've been struggling with MEV bots now on token launches on ETH...

I know this is off-topic here but it's the only way I found to reach you :)

Some sniping bots are developing Smart contract to fight them, any idea on how to do the same ?
image

Thanks bro :)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.