How to import bytecode in javascript? #5286
-
So, I need to create contracts by clicking a button and for that I need a ContractFactory which requires a bytecode. I've got the bytecode using solc:
The problem is that the loader fails while trying to import it inside the react component using
Is the error I got. |
Beta Was this translation helpful? Give feedback.
Answered by
alymurtazamemon
Apr 20, 2023
Replies: 1 comment 5 replies
-
@Iancu15 Which development environment are you using? Hardhat? |
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@lancu15 Yes, For example, if your contract name is
SimpleStoreage
then in your hardhat project inside artifacts folder you will find thecontracts
folder and inside it, you will find theSimpleStorage.sol
folder inside it, you will find theSimpleStoreage.json
file. You can move this file (manually or using script whatever you like) in the nextjs project and import theabi
andbytecode
from that file and using it you can create the contract object like we did in lesson 5.