Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 14 additions & 11 deletions build-on-abstract/smart-contracts/hardhat/deploying-contracts.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -195,22 +195,25 @@ to be provided within the factory dependencies array.

[Learn more about factory dependencies](/how-abstract-works/evm-differences/contract-deployment).

```typescript [expandable] {5-6,16}
```typescript [expandable] {4,9}
import { Wallet } from "zksync-ethers";
import { HardhatRuntimeEnvironment } from "hardhat/types";
import { Deployer } from "@matterlabs/hardhat-zksync";
import { vars } from "hardhat/config";

// Additional bytecode dependencies (typically imported from artifacts)
const contractBytecode = "0x..."; // Your contract bytecode

const wallet = new Wallet(vars.get("DEPLOYER_PRIVATE_KEY"));
const deployer = new Deployer(hre, wallet);
const artifact = await deployer.loadArtifact("FactoryContract");
const contract = await deployer.deploy(
artifact,
["Hello world!"],
"create",
{},
[contractBytecode]
);
export default async function (hre: HardhatRuntimeEnvironment) {
const wallet = new Wallet(vars.get("DEPLOYER_PRIVATE_KEY"));
const deployer = new Deployer(hre, wallet);
const artifact = await deployer.loadArtifact("FactoryContract");
const contract = await deployer.deploy(
artifact,
["Hello world!"],
"create",
{},
[contractBytecode]
);
}
```