Questions tagged [bsc]

Binance Smart Chain (BSC) is a blockchain network built for running smart contract-based applications.

Filter by
Sorted by
Tagged with
0
votes
1answer
12 views

How to work amountIn and amountOut in swapExactTokensForTokens of method smart contract?

I don't understand, smb explain me how to work amountIn and amountOut? For example: I have 10bnb, I want to another token for 1 bnb, it means amountIn = 1bnb I understand it. But, I can't understand ...
0
votes
1answer
20 views

BSC Flashloan getting Pancake:Locked

im trying to get a flashloan in pancakeswap - BSC, but i'm getting locked from the locked modifier in the pair: modifier lock() { require(unlocked == 1, 'Pancake: LOCKED'); unlocked = 0; _;...
0
votes
1answer
20 views

How do crypto games make users not pay gas

I am researching blockchain games, such as Axie Infinity, Crypto Cars, etc. As I understand it, when connecting a website to the ethereum/BSC blockchain to submit a transaction, the user will have to ...
0
votes
1answer
18 views

Subscribe to PairCreated Event on PancakeSwap's Factory Contract

I'm using ethersjs and bscscan to try and subscribe to the PairCreated event on the factory contract of PancakeSwap. I do the following and run it with node: const ethers = require('ethers'); const { ...
0
votes
1answer
25 views

Binance Smart Chain contract with withdraw and replenishment in both BUSD and USDT currencies

I have a task to make Solidity smart contract based on Binance Smart Chain network. That contract must withdraw and replenishment of funds with supporting both USDT and BUSD currences. But in contract ...
0
votes
1answer
6 views

How to ask to send a busd transaction using ethers

I have tried to make a function in a dapp to ask the user to send X BUSD to a wallet. The problem is that I cannot figure out how to make it ask for BUSD instead of ETH. try { if (!window....
0
votes
0answers
12 views

Ethers - Reading Staked Balance from Staking Contract

I'm trying to read the value of a given token that is staked or locked. I can get this to work for DuckStarter's staking contract in NodeJS using the EthersJS package like so: // THIS WORKS async ...
1
vote
1answer
38 views

Unable to connect to BSC testnet with web3.js

From this tutorial, I learned the RPC URL for BSC Testnet is https://data-seed-prebsc-1-s1.binance.org:8545, but when I use it with web3.js like: const web3 = new Web3('https://data-seed-prebsc-1-s1....
0
votes
0answers
17 views

Signing with BSC Provider causes unknown ENS error

I am not sure why this is throwing an error. From all the examples I've looked it up, it seems correct, but no amount of chaning how i send the provider makes the error go away. mintReward: function(...
0
votes
1answer
41 views

How to add a fee for each swap

I'm making a small NFT tool and I'm having troubles calculating the fee and making the user pay for it, the fee itself is 0,10% and I want to apply it to each time the function createMarketSale is ...
0
votes
0answers
11 views

Function call reverted when it is called two times in another function

I try to write a contract where you can swap different assets at once using 1inch DEX. Everything is working fine (getting data from 1inch api, call the contract, ...) except when I swap more than one ...
0
votes
1answer
74 views

Fail with error 'TransferHelper: TRANSFER_FROM_FAILED' even approved in contract

I'm rying to swap some BNB -> Token, then swap it back, all in one solidity function. Here's my code: interface IERC20 { function approve(address spender, uint256 value) external returns (bool);...
0
votes
2answers
29 views

Why does gas usage differ so much for two very similar functions that just check a condition and set a boolean?

I am facing one issue when interacting with my smart contract. Just to add, I have deployed by smart contract in bsc testnet. It has two similar functions- enableQuestion & disableQuestion, whose ...
0
votes
0answers
22 views

Best approach to transfer a % of a token

i´m very new in blockchain and i'm trying to understand how to handler the amounts and values. I want to transfer 10% of the total token BEP20 amount to an array of wallets. Is this a good way to do ...
0
votes
0answers
11 views

Monitor transactions with Lambda Function and Binance Smart Chain

I'm developing a lambda function that will be monitoring my address to see if I receive transactions. I see here three options: Subscribe to eth, such as https://gist.github.com/jonasbostoen/...
2
votes
1answer
76 views

Same ERC20 token on both BSC & Ethereum networks

I'm developing a ERC20 token to deploy on BSC network. But the client requests that the token should be on both BSC & Ethereum networks. I did a research and found out these methods. Binance ...
0
votes
0answers
23 views

Occasionally, I get the error: code -32000, message: header not found. When working with smart contracts with web3 in nodejs [duplicate]

I've tried to fix this for a whole day now. I've read the answers to the question: What is that error called "code: -32000, message: 'header not found'" when I deploy smart contracts ...
0
votes
1answer
87 views

Undefined output when using getPair and getReserves in web3 / node.js

Happy new year to you all! I am trying to get the wBNB/BUSD pair address from Pancakeswap (using getPair) and then check for their liquidity (using getReserves). I have pretty much copied the code ...
0
votes
1answer
37 views

How does BCS scan keep track of BEP20 token holders

Is there a function within the contract that needs to return the amount of holders or is it on BSC scan side. I know for Ether scan they keep track of it through transactions but I have done multiple ...
0
votes
1answer
45 views

Regarding amountOutMin not reverting a TX

I'm trying to find a safe way to swap during token launches. Is there any? I tried swapping 0.01 BNB (~$5 atm) for amountOutMin = 10 BUSD (via swapExactETHForTokens), but the tx is never failing.. ...
0
votes
0answers
39 views

How to properly use web3.py with BSC archive node?

I use the web3 python library and Moralis archive node to interact with BSC. I've got a few failed transactions on PancakeSwap a few days ago and am trying to replay them with different parameters ...
0
votes
1answer
39 views

Understanding decompiled source code of a smart contract

I decompiled a contract on BSC with bsc decompiler. And I can't understand storage declaration: # # Panoramix v4 Oct 2019 # Decompiled source of bsc:0x698E165F2897e4daC68671c4cDFf337bbC543767 # # ...
0
votes
0answers
26 views

Why can I buy contract by BUSD? [closed]

from web3 import Web3 import json import config import time bsc = "https://bsc-dataseed.binance.org/" web3 = Web3(Web3.HTTPProvider(bsc)) print(web3.isConnected()) ...
0
votes
1answer
1k views

Why did my transaction fail? (BEP20 token in BSC)

I just created a BEP20 token in Remix and deployed it on the BSC Testnet. When I try to transfer tokens from my Metamask account, give me this message in Transaccion Data: Transaction decoding is not ...
0
votes
0answers
11 views

Dev Set fee before listing

Can i develop a Dex smart contract that allows the Dev to set % of fee charges when adding Liquidity for the first time on a specific pair, where part of % fee charges goes to the Dev wallet?
0
votes
2answers
12 views

Understanding errors

So, I'm setting upon percentage shaving on a token, but I keep throwing an error. Anyone can point to some resource to understand what the heck I am doing wrong?
0
votes
0answers
37 views

Web3JS - Error: "gas" is missing

I have created a contract token on BSC Scan. But I'm getting an error when transferring tokens to another wallet address. My code const name = await this._contract.methods.name().call(); const symbol =...
0
votes
0answers
9 views

Any way to transfer tokens to address from frontend?

Hello guys i'm making a game i created an function that the player can deposit funds and the function transfer to one address and now i want to create a function of withdraw but how can i make this ? ...
0
votes
1answer
25 views

Monitor for all events

It is possible to monitor for all events that happens on Ethereum network or Binance Smart Chain network (BSC). I know that would be a lot of data however I would like later to filter that data. If ...
1
vote
0answers
21 views

transaction got reverted after call deposit function of weth, very strange behavior

address private immutable owner; IWETH private constant WETH = IWETH(0x358AA13c52544ECCEF6B0ADD0f801012ADAD5eE3); receive() external payable { if (msg.value > 0) { WETH....
1
vote
0answers
12 views

Setting up a full node while getting err="etherbase must be explicitly specified"

I was trying to setup a full node and getting err="etherbase must be explicitly specified". I followed the steps here https://docs.binance.org/smart-chain/developer/fullnode.html and syncing ...
1
vote
1answer
34 views

Withdrawing from Smart Contract?

Many projects on BSC seems to have pretty much forked SafeMoon with this being a popular one. For some reason - I see this particular contract storing BNB in the contract address itself. Is there a ...
1
vote
0answers
13 views

Ive sent BNB from my metamask BSC network to my gnosis safe contract ETH network version 1.1.1

Good evening guys i have a problem and i will try to explain it. BNB on my metamask wallet sent BNB from BSC network to my gnosis safe eth contract how can y replay the transaction if my error was ...
1
vote
0answers
18 views

Unexplained listing alert

Sorry for the newbie question But there are actually telegram channel which deliver listing alert seconds to minutes before the actual listing on CoinMarketCap and CoinGecko They claim they dont work ...
0
votes
1answer
58 views

how to get full info of a transaction hash? Web3.py or Web3.js

I am Aditya and I want to know How to get the details of transactions through Web3. See This TX Hash Of BscScan: https://bscscan.com/tx/...
1
vote
1answer
141 views

Sell Function on Pancakeswap with Ether Library on Node.js

I am trying to swap my busd tokens for bnb (wbnb) by using pancakeswap router v2 on testnet. Though I am having CALL_EXCEPTION. Before I dive into code, I have the same issue on bscscan. I don't know ...
1
vote
0answers
12 views

How to know an address balance X number of days ago?

Im creating a new contract at the moment. With one of the features im trying to implement i need to know what the senders address balance was 28 days ago. My current idea is to store an mapping of all ...
0
votes
1answer
103 views

How get estimated gas before sending the transaction?

How do you get the "estimated gas" from a "swapExactETHForTokens" function? As shown in metamask (before one can accept the purchase) Binance Smart Chain (BSC) From the pancakeswap ...
0
votes
0answers
108 views

Declaration Error: Non-abstract contracts cannot have internal constructors

I am having a DeclarationError: Non-abstract contracts cannot have internal constructors. Remove the "internal" keyword and make the contract abstract to fix this. This is the Code: ...
0
votes
0answers
15 views

What can I do to my contract to work with BEP20 mainnet

I'm trying to make an ICO for my Token. I wrote the code and its worked. The problem is I can only buy coins with ETH but I want to launch my token in the BEP20 network so people will need to send BNB ...
0
votes
0answers
15 views

BSC EtherJS find route path?

I'm trying to understand the route when we swap something in PancakeSwap. In the picture above we can see the best route that Pancake provides which is BNB -> BUSD -> HPL. But I don't know how ...
0
votes
0answers
19 views

I ask for help, I can't take my bnb

I have a very bad situation. I have a contract with the code: `using SafeMath for uint256; using Address for address; mapping (address => uint256) private _rOwned; mapping (address => uint256) ...
0
votes
0answers
21 views

Get a token price in date range on BSC network

I'm trying to find a token price in history, from a specific date to today date. And also I wanna get this information by token smart contract address. for example, get price history by token address: ...
0
votes
1answer
63 views

Transaction reverted by the EVM Pancake swap token sale

I have a function which sells tokens from an address on Pancake swap. I tested this using low slippage coins, but when running automatically in production i get a 'TRANSFER_FROM_FAILED' error. I am ...
0
votes
0answers
13 views

How to fork ethereum and change native currency name [duplicate]

I am trying to fork Ethereum ( https://github.com/ethereum/go-ethereum ) but don't know: How can I create a custom native currency(replacing ETH with custom name like PQR). How will my native ...
0
votes
1answer
85 views

BSC full node have more states than reason

I'm currently trying to setup a BSC full node on an AWS EC2 i3en.xlarge (so the config should be OK). I've follow these steps : https://docs.binance.org/smart-chain/developer/fullnode.html Note that I'...
0
votes
0answers
84 views

web3.eth.Contract using getPair error: "This contract object doesn't have address set yet, please set an address first."

I am trying to get the contract address for two tokens (WBNB and DOBO) using the getPair method but get the error "This contract object doesn't have address set yet, please set an address first.&...
0
votes
0answers
35 views

Decode Pancakeswap PairCreated data from logs

I want to decode the pancakeswap PairCreated Data event from the logs for example: I am able to get the data in HEX: https://bscscan.com/tx/...
0
votes
0answers
18 views

Difference between two PancakeRouter on bscscan

There are 2 PancakeRouter on BSC. 0x10ED43C718714eb63d5aA57B78B54704E256024E 0x05fF2B0DB69458A0750badebc4f9e13aDd608C7F What is the difference between the two and which one should I use for calling ...
1
vote
1answer
42 views

Run Chainlink node for BSC main / testnet

I'm trying to get full potential of using Chainlink to interact between smart contracts and APIs and currently I'm a little stuck at running a Chainlink node for BSC main / testnet. I see in their ...

1
2 3 4 5
7