Git Product home page Git Product logo

honeypotrescuewithsafebuy's Introduction

HoneypotRescueWithSafeBuy

On-chain honeypot detection with SafeBuy proxy method for secure transfers. Includes funds withdrawal rescue tools from honeypots and MasterChef contracts. Inherits from MembershipDAO contract (https://github.com/jddunn/MembershipDAO), so only subscribed members to the contract can call these functions.

Note: This is a POC contract and is not meant for production purposes.

Cross-chain supported by passing in a router or factory address.

Supported functionality:

  • Honeypot detection (smart contract pays for test funds, minimal amount tested)

    honeypotCheck(address targetTokenAddress, address routerAddr)

    returns:

    struct HoneypotCheckResponse {
          uint256 buyResult; // Result of buying transaction of honeypot token test
          uint256 targetTokenBalance; // Balance of the token we wanted to transfer (Usually set to $minTransactionAmount)
          uint256 sellResult; // Result of sell transaction of honeypot token test (If it's greater than 0 then we were able to sell)
          uint256 buyCost; // Cost of the gas to buy
          uint256 sellCost; // Cost of the gas to sell 
          uint256 expectedAmount; // How much user expected to receive. This will be equal to our $minTransactionAmount in the default test.
      }
    

    If sellResult is 0, then it's a honeypot.

  • Honeypot detection (user pays for test funds from transfer transaction)

    honeypotCheckCustomAmount(address targetTokenAddress, address routerAddr) payable

    returns:

    HoneypotCheckResponse

  • SafeBuy proxy method for secure transactions

    This method automatically checks for honeypot transactions (contract pays test fees) before allowing a user transfer transaction to go through.

    Will return swapped tokens if approved transaction or original tokens back to user if a honeypot is found.

    safeBuy(address targetTokenAddress, address routerAddr) payable

  • Honeypot rescue emergency withdraw (emergency withdrawal from MasterChef all pools)

    emergencyWithdrawFromAllPoolsInMasterChef(address addr)

  • Honeypot rescue bypass sell (attempts a transfer using Factory methods in case honeypot contract has disabled transfers).

    User must deposit liquidityToken amount to swap first with depositToken(tokenAddr) payable.

    honeypotBypass(address honeypotToken, address liquidityToken, address factoryAddr) payable

    If a swap cannot be done through DEX, the user can withdraw their liquidityToken with withdrawToken(tokenAddr) payable.

  • Honeypot rescue bypass sell (custom amount of liquidityToken to swap)

    honeypotBypassCustomAmount(address honeypotToken, address liquidityToken, address factoryAddr, uint256 amount) payable

honeypotrescuewithsafebuy's People

Contributors

jddunn avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

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.