Deploy a Smart Contract to Localhost with scaffold-eth

Ryan Harris
InstructorRyan Harris
Share this video with your friends

Social Share Links

Send Tweet
Published 2 years ago
Updated 2 years ago

Simply deploy your smart contracts with the scaffold by running yarn deploy. Once deployed your can view your contract in the UI.

But, the default smart contract that comes with scaffold-eth isn’t useful for our NFT ticketing app. So, we’ll edit the contract to have a saleIsActive state and write a couple of functions that update the state to true or false

Justyn Nelson
Justyn Nelson
~ 2 years ago

Hi Ryan, Thanks for making this lesson. I have a question, when I run yarn deploy I see "<UnrecognizedContract>" instead of something like "YourContract" eth_sendTransaction Contract deployment: <UnrecognizedContract>" and similarly when I interact with the contract, I see: " Contract call: <UnrecognizedContract>" instead of something like "YourContract#SetPurpose" in the chain console. Any idea what may cause this?

Sterling Cobb
Sterling Cobb
~ 2 years ago

Hey Ryan,

I keep getting this:

╰─ yarn deploy                                                                                                                                                      ─╯
yarn run v1.22.19
$ yarn workspace @scaffold-eth/hardhat deploy
$ hardhat deploy --export-all ../react-app/src/contracts/hardhat_contracts.json
Compiling 1 file with 0.8.4
Compilation finished successfully
transaction 0xd1618ffa9c271c4efe08b4258bef7a1cbb757b376c9c0c0c2a99c7a2e1113b8c still pending... It used a gas pricing config of (gasPrice: 3276839451 wei) ,
              current gas price is 1451540080 wei

✔ Choose what to do with the pending transaction: · skip (forget tx)
deploying "YourContract" (tx: 0x1378ca0a6a0d55eb5964117498fd0082000888a9ca5dda9fc133ecaf302d2a1d)...

If I re-run the yarn deploy command it will ask me if I want to wait, increase gas price or skip, when I skip, it seems to hang there forever trying to deploy but nothing happens. Any idea on what's going on?

Sterling Cobb
Sterling Cobb
~ 2 years ago

Ok now I"m getting

Errors encountered in param 0: Invalid value 4 supplied to : QUANTITY
Lucas Minter
Lucas Minter
~ 2 years ago

Hey Sterling. This is a pretty hard question to answer but here is a link to the hardhat docs: Let me know if this helps.

Markdown supported.
Become a member to join the discussionEnroll Today