blacksmith-eth / blacksmith

🔨 An adaptive frontend for smart contract interaction
MIT License
314 stars 28 forks source link

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

Open a4dyn opened 1 year ago

a4dyn commented 1 year ago

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

Additional context Please let me know if there is any way to fix it. I am happy to learn and help. Thanks.

unholypanda commented 1 year ago

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 commented 1 year ago

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

a4dyn commented 1 year ago

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 commented 1 year ago

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