iotaledger / iota-wiki

IOTA Wiki
https://wiki.iota.org
Other
112 stars 273 forks source link

Update the Deploy a Smart Contract page #1575

Closed Ginowine closed 1 month ago

Ginowine commented 1 month ago

Describe the solution you'd like

  1. The current "npx hardhat" command does not include the "Create a basic sample project" option as used on this page. Instead, it presents the following options:

The instruction to "Select 'Create a basic sample project'" should be replaced with one of the above options in step 5 of the process.

  1. Additionally, it would be beneficial to include instructions on obtaining YOUR PRIVATE KEY, as demonstrated on this page.

  2. The current deploy.js script produces the following error:

TypeError: counter.deployed is not a function

Fix:

Commenting out await counter.deployed() allows the contract to be deployed, but to an undefined address. Using await counter.getAddress() in the console log statement correctly displays the deployed address. We should replace counter.address with await counter.getAddress() to properly display the address.