Skip to content

abhishek23x/ZAMA-X-EARN-BY-ABHI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

2 Commits
ย 
ย 

Repository files navigation

๐Ÿ›ก๏ธ Zama Developer Program โ€“ Level 2 Guide (100% Working on Codespace)

Complete Level 2 of the Zama Developer Program using GitHub Codespace โ€” clean, fast, and tested โœ…


โœ… Level 2: โ€œWrite Your First Confidential Smart Contractโ€

๐Ÿ”น STEP 1: Open Template in Codespace

  1. Go to ๐Ÿ‘‰ https://github.com/zama-ai/fhevm-hardhat-template
  2. Click the green Code button
  3. Select โ†’ Open with Codespaces โ†’ + New codespace
  4. Wait for Codespace to fully load and initialize

๐Ÿ”น Step 2: Clean and Recreate Contracts Folder

rm -rf contracts/*
mkdir contracts
touch contracts/Calculator.sol

๐Ÿ”น Step 3: Add Calculator Contract

  1. Open contracts
  2. Right Click
  3. Add file
  4. 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;
    }
}

๐Ÿ”น Step 4: Install Required Packages

npm install
npm install @fhenixprotocol/contracts --save

๐Ÿ”น Step 5: Compile the Contract

npx hardhat compile

Output should show: Compiled 1 Solidity file successfully


๐Ÿ”น Step 6: Claim Level 2 on Guild - https://guild.xyz/zama/developer-program


โœ… Level 3: โ€œSubmit Contract Addressโ€


๐Ÿ”น Step 1: Create scripts Folder

mkdir scripts

๐Ÿ”น Step 2: Create Deploy Script File

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;
});

๐Ÿ”น Step 3: Deploy the Contract

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.


๐Ÿ”น Step 4: Claim Level 3

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

๐Ÿง  Join our Telegram Community
For live help, updates, & early alpha drops
๐Ÿ‘‰ https://t.me/earnbyabhi23


About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published