blacksmith
blacksmith copied to clipboard
Contract "import failed" on BSC/BSC Testnet fork
Abstract I was trying to use blacksmith to test contracts on BSC/BSC Testnet fork. But when I tried to import contracts on blacksmith's local website it shows "import failed", tested several times, both BSC/BSC Testnet won't work.
What I did
- Following the instruction, I cloned blacksmith and run it with
yarn dev
- Then I forked the BSC mainnet via anvil, using
anvil --fork-url https://bsc-dataseed1.binance.org/
. The network was forked successfully and wallets are generated. I also saw the "Chain 56" instruction at the blacksmith web (http://localhost:3000/) - I found a random contract on bscscan.com, let's say PancakeSwap MasterChef (0x73feaa1ee314f8c655e354234017be2193c9e24e), when I tried to import it in the via "Contact Management" in blacksmith, it shows "Import Failed".
- I tried with ETH network and it works fine. So I guess there's some configuration wrong with networks outside of ETH?
Screenshots
Initial State:
After I tried to import a contract via blacksmith:
System (please complete the following information):
- Browser: Chrome
- Blacksmith Short SHA: f23b2dd
- Anvil Version: anvil 0.1.0 (2ff9902 2023-01-11T00:22:04.738793Z)
- Forge Version: forge 0.2.0 (2ff9902 2023-01-11T00:22:04.500579Z)
Additional context Please let me know if there is any way to fix it. I am happy to learn and help. Thanks.
Thanks for filing this issue @a4dyn!
Unfortunately, the contract import functionality doesn't adapt to retrieve contracts from the appropriate block explorer/verifier based on the active chain (yet). Right now it is hardcoded to only import from Ethereum mainnet via Etherscan. I've actually been working to add support for other chains, but what I have right now isn't quite production ready.
As a quick fix I'll make this clearer in the instructions of the contract management section and I'll work on getting full support for importing contracts from other chains like BSC as soon as possible!
Added some additional language to the Contract Management section in #105.
Thanks for filing this issue @a4dyn!
Unfortunately, the contract import functionality doesn't adapt to retrieve contracts from the appropriate block explorer/verifier based on the active chain (yet). Right now it is hardcoded to only import from Ethereum mainnet via Etherscan. I've actually been working to add support for other chains, but what I have right now isn't quite production ready.
As a quick fix I'll make this clearer in the instructions of the contract management section and I'll work on getting full support for importing contracts from other chains like BSC as soon as possible!
Thanks for the reply! I would love to help you developer such features if needed. Should I go ahead and close this issue or leave it open until such feature is added? Thanks :)
Let's leave the issue open until the feature is added. I'll just change the label from bug
to enhancement
.