Complete Level 2 of the Zama Developer Program using GitHub Codespace โ clean, fast, and tested โ
- Go to ๐ https://github.com/zama-ai/fhevm-hardhat-template
- Click the green Code button
- Select โ Open with Codespaces โ + New codespace
- Wait for Codespace to fully load and initialize
rm -rf contracts/*
mkdir contracts
touch contracts/Calculator.sol
- Open
contracts
- Right Click
- Add file
- Create
/Calculator.sol
and paste this code:
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;
contract Calculator {
function encryptedAdd(uint32 a, uint32 b) public pure returns (uint32) {
return a + b;
}
}
npm install
npm install @fhenixprotocol/contracts --save
npx hardhat compile
Output should show: Compiled 1 Solidity file successfully
๐น Step 6: Claim Level 2 on Guild - https://guild.xyz/zama/developer-program
mkdir scripts
touch scripts/deploy.js
โข Then in Codespace (left sidebar):
โ Open scripts/deploy.js
โ Paste the following code:
const hre = require("hardhat");
async function main() {
const Calculator = await hre.ethers.getContractFactory("Calculator");
const calculator = await Calculator.deploy();
await calculator.waitForDeployment();
console.log("Calculator deployed to:", await calculator.getAddress());
}
main().catch((error) => {
console.error(error);
process.exitCode = 1;
});
Run this in terminal:
npx hardhat run scripts/deploy.js
Expected output:
Calculator deployed to: 0xAbC...123
That address is your deployed smart contract address.
Visit: https://guild.xyz/zama/developer-program
โ Find Level 3: Deploy your confidential contract โ Paste your deployed contract address
๐ Youโve completed Level 3!
๐ Guide Created by: @EarnByAbhi
Follow & Stay Connected for More Zama Alpha, Airdrops & Dev Tutorials
- ๐ X (Twitter): @EarnByAbhi
- ๐ฌ Telegram: @EarnByAbhi23
โถ๏ธ YouTube: EarnByAbhi
๐ง Join our Telegram Community
For live help, updates, & early alpha drops
๐ https://t.me/earnbyabhi23