Binance Smart Chain is a blockchain with a public ledger that supports Ethereum applications (EVM). This tag should only be used for programming questions related to Binance Smart Chain. Use [binance-chain] for questions about writing code that interacts with the original, non-smart Binance Chain.
Questions tagged [binance-smart-chain]
235 questions
3
votes
1 answer
Calculating price of BSC token with Web3 and Python
I'm building a tool with web3 and python that needs to quickly and accurately get prices of tokens on Binance Smart Chain via PancakeSwap.
The tool gathers information about BSC tokens, price, liquidity etc so I can further analyse rugpulls.
In the…

James
- 101
- 2
- 10
3
votes
1 answer
How can i fork Binance Smart Chain and create my own blockchain
I want to fork Binance smart chain so that i can have a whole new blockchain.
By this i mean it will have a new name, ticker, users will be able to develop on top of it just like BSC.
How do i go about it?

Rimproverato
- 41
- 2
3
votes
0 answers
How can I see my pending transactions in the BSC pending pool?
I'm currently trying to get data from the BSC pending transactions, so I have been using this coding lines to see the changes in the mempool:
web3_filter= web3.eth.filter('pending')
transaction_hashes =…

Oriok
- 63
- 7
3
votes
2 answers
Exception in fetchPairData() : call revert exception in method getReserves()
I am trying to call the "fetchPairData" function (https://uniswap.org/docs/v2/SDK/fetcher/) but I am getting the following error.
Error: call revert exception (method="getReserves()", errorSignature=null, errorArgs=[null], reason=null,…

user2983041
- 1,761
- 4
- 19
- 31
3
votes
0 answers
Solidity - String Template Literal
How do I use string template literals on Solidity like JavaScript offers out of the box?
I need to write a multiline string in my ERC20 and would like to leverage something that doesn’t require me writing a bunch of /n
i.e.
const…

Null isTrue
- 1,882
- 6
- 26
- 46
3
votes
1 answer
What is the Binance web socket connection URL?
var bnbWebSocketUrl = ?;
var web3 = new Web3(new Web3.providers.WebsocketProvider(bnbWebSocketUrl));

Antier Solutions
- 1,326
- 7
- 10
2
votes
0 answers
Fail with error 'hasFee'. web3.py, depositToken
I can't execute the transaction, I get the error
'Fail with error 'hasFee''
Code:
client.py
import logging
import traceback
from eth_account.signers.local import LocalAccount
from web3 import Web3
from typing import Optional
from web3.middleware…

Printon
- 31
- 2
2
votes
0 answers
How to send BSC transaction with golang
I have a Smart Chain wallet which i want to send a token or BSC from it to another address programmatically using Go.
I tried go-ethereum library and bnb-chain but i can't figure out how to do this.
Note: i don't want to run a full/light node to…

mohammad
- 31
- 3
2
votes
2 answers
get amount of tokens in a transaction from Txn Hash using Web3
Following the web3 documentation https://web3py.readthedocs.io/en/stable/examples.html#looking-up-transactions , I can get the transaction information like i have done below.
But it seems like i cant get the exact amount of token swapped in the…

Soma Juice
- 369
- 1
- 11
2
votes
2 answers
How to Approve spend of one Token with Web3.js?
I seek via my web page of test to create a button which allows to authorize the expenditure of a Contract (Token)..
If I go to the page and I click I would like the script to load web3 (it loads well) then if I press the button that Metamask…

John Axis
- 29
- 1
- 4
2
votes
1 answer
Ethers.js token price chart
I'm using Ethers.js to get the token price from BSC using getReserves successfully.
const nodeRandom = !node ? wssNodes() : node;
const provider = new ethers.providers.WebSocketProvider(nodeRandom);
const pairAddress = await…

Viet Nguyen
- 2,285
- 2
- 26
- 43
2
votes
1 answer
How to inject Binance Wallet into Web3 instead of Metamask?
I started using Binance Chain Wallet in my dapp, so I can now use:
import { BscConnector } from '@binance-chain/bsc-connector'
export const bsc = new BscConnector({
supportedChainIds: [56, 97] // later on 1 ethereum mainnet and 3 ethereum…

Mariusz Sidorowicz
- 336
- 3
- 12
2
votes
0 answers
Is the WalletConnect supporting the "Binance Smart Chain (BEP20)" wallets?
I was checking Kotlin WalletConnect App and it is working fine for the Etherium ERC20.
But I need to know is this possible to use this App for the Binance Smart Chain (BEP20) transactions?
If Yes, can you please share the methods?
I checked the code…

Khaksar
- 333
- 3
- 17
2
votes
1 answer
Go-Web3 Transaction failing due to Insufficient funds for gas* price + value
my transaction is failing for some reason due to {"code":-32000,"message":"insufficient funds for gas * price + value"}
I am executing a pancakeswap transaction to swap a token for bnb. I have the gas set to 5 gwei and I have web3 getting the gas…

0xKitsune
- 131
- 6
2
votes
0 answers
Transaction Underpriced in BSC network
No matter what I try to do, always in a purchase attempt using web3 I get ( {'code': -32000, 'message': 'replacement transaction underpriced'} ).
I've tried everything, increase gas, change values, pay more but nothing works... could someone smart…

Raphael
- 21
- 1