Coder Social home page Coder Social logo

pythonsniperbot's Introduction

pythonSniperbot

Sniper Bot that waits for a specific pair to be created, once detected bot buys token for the amount specified

pythonsniperbot's People

Contributors

codewithjoe2020 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  avatar  avatar  avatar

pythonsniperbot's Issues

binascii.Error: Non-hexadecimal digit found

So when i try to run your scripts on my laptop
It gives this error. can you suggest how can i fix it ?
True
{"args": {"token0": "0xB690CCE5cAAB6dE576609A5801B94178aE40A99d", "token1": "0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c", "pair": "0x6f10e8818b7F07e864dC8bF82ca72CD3644E2382", "": 554595}, "event": "PairCreated", "logIndex": 406, "transactionIndex": 96, "transactionHash": "0x62719ae1f4fa5dc1f59d64107e2a3afcea630a73072876144e443f8e5a110837", "address": "0xcA143Ce32Fe78f1f7019d7d551a6402fC5350c73", "blockHash": "0x470d6a54835992a4737f63e85421464da71325542af3a05e87cbc1186b9c1a2f", "blockNumber": 12745866}
Token0: "0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c"
Token1: "0xB690CCE5cAAB6dE576609A5801B94178aE40A99d"
next pair
here
Traceback (most recent call last):
File "sniper.py", line 123, in
main()
File "sniper.py", line 112, in main
loop.run_until_complete(
File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/asyncio/base_events.py", line 616, in run_until_complete
return future.result()
File "sniper.py", line 98, in log_loop
handle_event(PairCreated)
File "sniper.py", line 89, in handle_event
buy()
File "sniper.py", line 50, in buy
signed_txn = web3.eth.account.sign_transaction(pancakeswap2_txn, 'tuition humble gun budget equal collect polar rally virus warfare fix tennis')
File "/Users/rahuja/Library/Python/3.8/lib/python/site-packages/eth_utils/decorators.py", line 18, in _wrapper
return self.method(obj, *args, **kwargs)
File "/Users/rahuja/Library/Python/3.8/lib/python/site-packages/eth_account/account.py", line 727, in sign_transaction
account = self.from_key(private_key)
File "/Users/rahuja/Library/Python/3.8/lib/python/site-packages/eth_utils/decorators.py", line 18, in _wrapper
return self.method(obj, *args, **kwargs)
File "/Users/rahuja/Library/Python/3.8/lib/python/site-packages/eth_account/account.py", line 250, in from_key
key = self._parsePrivateKey(private_key)
File "/Users/rahuja/Library/Python/3.8/lib/python/site-packages/eth_utils/decorators.py", line 18, in _wrapper
return self.method(obj, *args, **kwargs)
File "/Users/rahuja/Library/Python/3.8/lib/python/site-packages/eth_account/account.py", line 774, in _parsePrivateKey
return self._keys.PrivateKey(HexBytes(key))
File "/Users/rahuja/Library/Python/3.8/lib/python/site-packages/hexbytes/main.py", line 23, in new
bytesval = to_bytes(val)
File "/Users/rahuja/Library/Python/3.8/lib/python/site-packages/hexbytes/_utils.py", line 17, in to_bytes
return hexstr_to_bytes(val)
File "/Users/rahuja/Library/Python/3.8/lib/python/site-packages/hexbytes/_utils.py", line 50, in hexstr_to_bytes
return binascii.unhexlify(ascii_hex)
binascii.Error: Non-hexadecimal digit found

Web3.Exception.ABIEventFunctionNotFound

Hello Joe! Great script!!!
I'm having troubles when tried to use pancakeswap instead Uniswap.
with Pancakeswap, I'm getting the error:

Traceback (most recent call last):
  File "c:\Users\H\OneDrive\Scripts\python\Garbage_Tests\code_w_Joe_sniping_v1.py", line 116, in <module>
    main()
  File "c:\Users\H\OneDrive\Scripts\python\Garbage_Tests\code_w_Joe_sniping_v1.py", line 102, in main
    event_filter = contractbuy.events.PairCreated.createFilter(fromBlock='latest')
  File "C:\Users\H\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\web3\contract.py", line 254, 
in __getattr__
    raise ABIEventFunctionNotFound(
web3.exceptions.ABIEventFunctionNotFound: ("The event 'PairCreated' was not found in this contract's abi. ", 'Are you sure you provided the correct contract abi?')

I see you are using "contract" for uniswap and "contractbuy" for pancakeswap:
contract = web3.eth.contract(address=uniswap_factory, abi=uniswap_factory_abi)
contractbuy = web3.eth.contract(address=panRouterContractAddress, abi=panabi)

There is an issue with the ABI contract in PancakeSwap, that really doent have paircreated event?

Error: filter not found (sometimes happens, others not) - Running Python on Windows (Anaconda)

Traceback (most recent call last):
File "sniperBot.py", line 125, in
main()
File "sniperBot.py", line 116, in main
log_loop(event_filter,2 )))
File "C:\Users\XXXXX\Anaconda3\lib\asyncio\base_events.py", line 488, in run_until_complete
return future.result()
File "sniperBot.py", line 99, in log_loop
for PairCreated in event_filter.get_new_entries():
File "C:\Users\XXXXX\Anaconda3\lib\site-packages\web3_utils\filters.py", line 160, in get_new_entries
log_entries = self._filter_valid_entries(self.eth_module.get_filter_changes(self.filter_id))
File "C:\Users\XXXXX\Anaconda3\lib\site-packages\web3\module.py", line 60, in caller
null_result_formatters)
File "C:\Users\XXXXX\Anaconda3\lib\site-packages\web3\manager.py", line 184, in request_blocking
null_result_formatters)
File "C:\Users\XXXXX\Anaconda3\lib\site-packages\web3\manager.py", line 162, in formatted_response
raise ValueError(response["error"])
ValueError: {'code': -32000, 'message': 'filter not found'}

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.