Aztec Deployment Skill
Generate production-ready TypeScript deployment scripts for Aztec smart contracts.
Subskills
Navigate to the appropriate section based on your task:
- Deploy Script - Full deployment script template
- Fee Payment - Fee payment methods and configuration
- Environment Config - Local network vs devnet setup
Quick Start: Basic Deployment Script
import { MyContract } from "../src/artifacts/MyContract.js";
import { Logger, createLogger } from "@aztec/aztec.js/log";
import { SponsoredFeePaymentMethod } from "@aztec/aztec.js/fee/testing";
import { setupWallet } from "../src/utils/setup_wallet.js";
import { getSponsoredFPCInstance } from "../src/utils/sponsored_fpc.js";
import { SponsoredFPCContract } from "@aztec/noir-contracts.js/SponsoredFPC";
import { deploySchnorrAccount } from "../src/utils/deploy_account.js";
import { getTimeouts } from "../config/config.js";
async function main() {
const logger = createLogger('aztec:deploy');
// 1. Setup wallet connection
const wallet = await setupWallet();
// 2. Setup sponsored fee payment
const sponsoredFPC = await getSponsoredFPCInstance();
await wallet.registerContract(sponsoredFPC, SponsoredFPCContract.artifact);
const paymentMethod = new SponsoredFeePaymentMethod(sponsoredFPC.address);
// 3. Deploy account (or use existing)
const account = await deploySchnorrAccount(wallet);
// 4. Deploy contract
const contract = await MyContract.deploy(wallet, account.address).send({
from: account.address,
fee: { paymentMethod }
}).deployed({ timeout: getTimeouts().deployTimeout });
logger.info(`Contract deployed at: ${contract.address}`);
}
main().catch(console.error);
Deployment Workflow
- Setup Wallet - Connect to Aztec node via PXE
- Configure Fees - Setup sponsored or other fee payment
- Create Account - Deploy Schnorr account or recover existing
- Deploy Contract - Send deployment transaction
- Verify - Confirm deployment succeeded
Key Imports
// Wallet and node connection
import { createAztecNodeClient } from '@aztec/aztec.js/node';
import { TestWallet } from '@aztec/test-wallet/server';
// Account management
import { Fr, GrumpkinScalar } from "@aztec/aztec.js/fields";
import { AccountManager } from "@aztec/aztec.js/wallet";
import { AztecAddress } from "@aztec/stdlib/aztec-address";
// Fee payment
import { SponsoredFeePaymentMethod } from "@aztec/aztec.js/fee/testing";
import { SponsoredFPCContract } from "@aztec/noir-contracts.js/SponsoredFPC";
// Logging
import { Logger, createLogger } from "@aztec/aztec.js/log";
Using Context7 MCP
For detailed API documentation and latest deployment patterns, use Context7:
Library ID: /aztecprotocol/aztec-packages