binance-smart-chain

buy and sell in one transaction in Web3, to check for honeypots

buy and sell in one transaction in Web3, to check for honeypots Question: How can i turn this buy function into a transaction that buys and sell in a single transaction? The reason behind this is to check if a token is a honeypot and will not allow me sell the token, but i dont …

Total answers: 2

How to get the price of BSC token directly the token pool contract in web3.py

How to get the price of BSC token directly the token pool contract in web3.py Question: I’m trying to get the price of some BSC token directly from the contract. Doing some searches, I found a mix of ideas with the snippet below. I’m sure the code is off because when I checked on https://pancakeswap.finance/swap …

Total answers: 1

Web3 Signing transaction issue Non-hexadecimal digit found (Python)

Web3 Signing transaction issue Non-hexadecimal digit found (Python) Question: I am trying to complete a transaction of buying a token in binance smart chain and I am getting an error at sign transaction part which I am unable to resolve. Code: PancakeABI = open(‘pancakeABI’,’r’).read().replace(‘n’,”) bsc="https://bsc-dataseed.binance.org/" web3 = Web3(Web3.HTTPProvider(bsc)) contract_id = web3.toChecksumAddress(tokaddr) #Checking balance for test …

Total answers: 1

Selling tokens and get BNB instead of wBNB?

Selling tokens and get BNB instead of wBNB? Question: I made a function that sells a token in the BSC smartchain. However, I want to receive it in BNB directly instead of wBNB. How can I unwrap the wBNB I receive? def sell_drdc(wallet_address, token_address, wallet_no): if not is_approved(token_address): approve(wallet_address, private_key) erc20 = web3.eth.contract(token_address, abi=erc20Abi) token_value …

Total answers: 1

Compute the LP Address of a token pair using web3.py

Compute the LP Address of a token pair using web3.py Question: I managed to have this code run after few hours of searches but unfortunately, this does not produce the output I wanted which is to get the LP Pool Address in (TOKEN/BNB LP). Given the Token Address: 0xe56842ed550ff2794f010738554db45e60730371 I wanted to get the BIN/BNB …

Total answers: 4