Closed bios42eth closed 2 years ago
Btw : tested on bsc tesnet and it works. It sounds like the bsc mainnet cannot be forked.
I did add some more info : I'm getting a wallet balance. On the direct access to bsc mainnet, it works fine. When I'm going through the fork, the balance is 0, whereas there is some BNB on the wallet. I've tried an all public bsc nodes, it doesn't work on mainnet. Once again : it works on testnets...
Came across this while trying to figure it out, just urious what rpc url are you using @bgantaume
npx hardhat node --fork https://bsc-dataseed.binance.org/ @abhishekr700
I see, I'm running into the same issue. @bgantaume
I see, I'm running into the same issue. @bgantaume
I don't know if it's a good news or not... :D Please not that it works just fine on the bsc testnet.
I'd be glad to dig deeper, but I just don't know where to look at...
@abhishekr700 @fvictorio Any idea of where I should start looking at ?
Nope, I'm switching to testnet for the meantime
Confirmed. Reproduction: start a fork using https://bsc-dataseed.binance.org/, then start a console with npx hardhat console --network localhost
and execute:
await network.provider.send("eth_getCode", ["0x10ED43C718714eb63d5aA57B78B54704E256024E", "latest"])
You'll get a value of 0x
. This doesn't happen if you connect to that RPC URL directly.
+1, forking mainnet or testnet is not working with
networks: {
hardhat: {
forking: {
url: 'https://data-seed-prebsc-1-s1.binance.org:8545/',
enabled: true,
},
accounts: {
accountsBalance: '1000000000000000000000000', // 1 mil ether,
},
},
...
}
Also running with:
hardhat node --network hardhat --show-stack-traces --fork https://data-seed-prebsc-1-s1.binance.org:8545
Are you guys getting testnet to fork with hh? I also tried RPCs:
https://bsc-dataseed1.defibit.io
https://bsc-dataseed.binance.org
Could it be that those RPCs are not connecting to archival nodes?
Nope, I'm switching to testnet for the meantime
How are you getting forking of the testnet to work?
Update, I can fork both main and testnets with ganache.
ganache-cli -f <RPC_URL> -m MNEMONIC-BIP39-STYLE
But still no luck with hardhat directly.
Just use moralis bro
ran in to the same problem
Just use moralis bro
This is true.
Disclaimer: I am not affiliated to moralis. This is just the best solution I have seen.
Why? Because the BSC RPC Endpoints are not achieve-nodes. Moralis on the other hand offers achieve nodes.
This issue was marked as stale because it didn't have any activity in the last 30 days. If you think it's still relevant, please leave a comment indicating so. Otherwise, it will be closed in 7 days.
This issue was closed because it has been stalled for 7 days with no activity.
Is Binance smart chain ( bsc mainnet) forkable or not? I need to get some smart contracts, already deployed on mainnet. Please reply @fvictorio @huwenchao @bios42eth @Jovonni @abhishekr700 . Thank you!
Hi, I have an issue with forking BSC mainnet. I don't really know if this is an issue or misuse. I have this piece of code running fine on bsc mainnet, but not when I'm forking bsc mainnet. I guess I'm doing something wrong...
Console :
Console :
On the fork console I have this message : WARNING: Calling an account which is not a contract It sounds like it cannot find the contract.
Localhost is a fork started with : npx hardhat node --fork https://bsc-dataseed.binance.org/
Here is my network config :
Here is the code :