Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Contract "import failed" on BSC/BSC Testnet fork #104

Open
a4dyn opened this issue Jan 13, 2023 · 4 comments
Open

Contract "import failed" on BSC/BSC Testnet fork #104

a4dyn opened this issue Jan 13, 2023 · 4 comments
Assignees
Labels
enhancement New feature or request

Comments

@a4dyn
Copy link

a4dyn commented Jan 13, 2023

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

  1. Following the instruction, I cloned blacksmith and run it with yarn dev
  2. 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/)
  3. 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".
  4. 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:
image
image

After I tried to import a contract via blacksmith:
image
image

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.

@a4dyn a4dyn added the bug Something isn't working label Jan 13, 2023
@unholypanda
Copy link
Member

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!

@unholypanda
Copy link
Member

Added some additional language to the Contract Management section in #105.

@unholypanda unholypanda self-assigned this Jan 13, 2023
@a4dyn
Copy link
Author

a4dyn commented Jan 14, 2023

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 :)

@unholypanda
Copy link
Member

Let's leave the issue open until the feature is added. I'll just change the label from bug to enhancement.

@unholypanda unholypanda added enhancement New feature or request and removed bug Something isn't working labels Jan 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants