Skip to content

Commit

Permalink
update create2 guide for salt config
Browse files Browse the repository at this point in the history
  • Loading branch information
zoeyTM committed Feb 17, 2024
1 parent 2aaae12 commit 5dfb127
Showing 1 changed file with 46 additions and 0 deletions.
46 changes: 46 additions & 0 deletions docs/src/content/ignition/docs/guides/create2.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,52 @@ This guide assumes you are using the contracts and Ignition module from the [qui

:::

Our last step before deploying is to add a custom salt for the deployment. This step is optional, but it's recommended to avoid any potential collisions with other deployments. You can add a custom salt via your Hardhat config:

::::tabsgroup{options=TypeScript,JavaScript}

:::tab{value=TypeScript}

```ts
export default {
// ...rest of your config...
ignition: {
strategyConfig: {
create2: {
salt: "custom-salt",
},
},
},
};
```

:::

:::tab{value=JavaScript}

```js
module.exports = {
// ...rest of your config...
ignition: {
strategyConfig: {
create2: {
salt: "custom-salt",
},
},
},
};
```

:::

::::

:::tip

To learn more about salts and how they work, as well as additional security considerations, please see the [CreateX documentation](https://github.com/pcaversaccio/createx?tab=readme-ov-file#permissioned-deploy-protection-and-cross-chain-redeploy-protection).

:::

You can now run the deployment with `create2` using the newly added Sepolia network:

::::tabsgroup{options="TypeScript,JavaScript"}
Expand Down

0 comments on commit 5dfb127

Please sign in to comment.