Skip to content

Conversation

@carletex
Copy link
Member

@carletex carletex commented Oct 29, 2025

Creating this draft so we can start tinkering & discussing:

For now:

  • Installed new deps (removed old ones)
  • Updated README with new NodeJS requirement (we might need to update in docs, etc)
  • yarn chain working
  • yarn deploy working
    • Using Ignition. Let's see if we don't need hardhat-deploy anymore (also available for HHv3)
    • Missing:
      • inheritedFunctions
      • deployedOnBlock

ToDo (will be adding more):

  • Fix GitHub lint workflow
  • Create new keystore system (move to custom one => hardhat-keystore / config Variables)
  • Make yarn deploy more generic. Before it deployed everything / tag-based. Now only the specified conttract.
  • --network for deploy (+ config networks on hardhat.config)
  • Verify / Etherscan API key
  • Tests (default should be solidity, TS or both?)
  • Mainnet Fork
  • TS Generation: get inherited functions + deployed block

Known Issues:

  • If I deploy, make a change to the contract, and deploy again, I get [ YourContract ] Nothing new to deploy based on previous execution stored in ./ignition/deployments/chain-31337

Fixes #1191

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Saving this for easier access :D

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Went with this solution for now (naming it generic, so people can deploy everything here by default.... since the module path is hardcoded on package.json)

e.g. This works:

export default buildModule("ScaffoldEthDeployModule", m => {
  const yourContract = m.contract("YourContract", ["0x0000000000000000000000000000000000000000"]);
  const yourContract2 = m.contract("YourContract2", ["0x0000000000000000000000000000000000000000"]);

  return { yourContract, yourContract };
});

they say in their docs

You can create multiple modules in a single file, but each must have a unique ID. To deploy a module, you must export it using module.exports = or export default. As a best practice, we suggest maintaining one module per file, naming the file after the module ID.

But I couldn't make it work (creating more modules in the file + exporting both)


Note: they also have https://hardhat.org/ignition/docs/guides/scripts, where you can do more "complex" logic (e.g. console.logs of contract read data)

chainType: "l1",
url: "https://mainnet.rpc.buidlguidl.com",
accounts: [deployerPrivateKey],
accounts: [configVariable("DEPLOYER_PRIVATE_KEY")],
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yarn hardhat keystore set DEPLOYER_PRIVATE_KEY

We'd need to abstract this to the user for yarn generate etc.

Also: for the keystore you need a 8 character password. Unless you use the --dev flag, which doesn't ask for a password at all https://hardhat.org/docs/guides/configuration-variables#improving-ux-when-using-keystore-values-during-the-dev-process


// If not set, it uses ours Alchemy's default API key.
// You can get your own at https://dashboard.alchemyapi.io
const providerApiKey = process.env.ALCHEMY_API_KEY || "cR4WnXePioePZ5fFrnSiR";
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can use regular env vars for non-critical data (like this key) and then the keystore (configVariable) for PKs, etc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Hardhat V3

2 participants