Skip to content

Instantly share code, notes, and snippets.

View Turupawn's full-sized avatar
🇭🇳
Karaoke veteran

Ahmed Castro Turupawn

🇭🇳
Karaoke veteran
View GitHub Profile
@Turupawn
Turupawn / Notes.md
Created June 3, 2024 20:23
Rise In: Intro to ZK Development

Tutorial

Circom

ZK Circom Logo

Installation

curl --proto '=https' --tlsv1.2 https://sh.rustup.rs -sSf | sh
@Turupawn
Turupawn / Notes.md
Created June 3, 2024 20:17
Rise In: Deploying and verifying a contract
const NETWORK_ID = 534351
const MY_CONTRACT_ADDRESS = "0xdE19032216f861c6011F6898B14fb49Fd26c45F2"
const MY_CONTRACT_ABI_PATH = "./json_abi/MyContract.json"
var my_contract
var accounts
var web3
function metamaskReloadCallback() {

Merkle demo

8411631094850346633429466206441955219061762119006426459772382946930606390748
  - 9708419728795563670286566418307042748092204899363634976546883453490873071450
      - 1
      - 2
  - 959253372465518657915465330794866170308951936404091375323782669660913720058
      - 3
 - 4
// run with node etherscan_script.mjs
var ACCOUNT = "XXX"
var API_URL= "https://api-optimistic.etherscan.io/api"
var API_KEY = "YYY"
var MY_TX_COUNT = 0
var INTRACTIONS_WITH_MY_CONTRACTS_COUNT = 0
var ONBOARDED_COUNT = 0
var ONBOARDED_MULTI_TX_COUNT = 0
@Turupawn
Turupawn / ZK_Intro.md
Last active May 17, 2024 16:13
zk intro

Install noir v17

Linux

mkdir -p $HOME/.nargo/bin && \
curl -o $HOME/.nargo/bin/nargo-x86_64-unknown-linux-gnu.tar.gz -L https://github.com/noir-lang/noir/releases/download/v0.17.0/nargo-x86_64-unknown-linux-gnu.tar.gz && \
tar -xvf $HOME/.nargo/bin/nargo-x86_64-unknown-linux-gnu.tar.gz -C $HOME/.nargo/bin/ && \
echo -e '\nexport PATH=$PATH:$HOME/.nargo/bin' >> ~/.bashrc && \
source ~/.bashrc
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.23;
import { IEAS, AttestationRequest, AttestationRequestData, RevocationRequest, RevocationRequestData } from "@ethereum-attestation-service/eas-contracts/contracts/IEAS.sol";
import { ISchemaRegistry, SchemaRecord, ISchemaResolver } from "@ethereum-attestation-service/eas-contracts/contracts/ISchemaRegistry.sol";
import { NO_EXPIRATION_TIME, EMPTY_UID } from "@ethereum-attestation-service/eas-contracts/contracts/Common.sol";
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol";

1. Clone the repo

git clone https://github.com/Sindri-Labs/sindri-resources.git
cd sindri-resources/circuit_database/circom/multiplier2

2. Change your circuit name

sindri.json

/*
Scroll gas fees are a combination of "L2 execution fees" (on Scroll) and "L1 security fees" (on Ethereum):
totalFee = (l2GasPrice * l2GasUsed) + l1Fee
Where:
- `l2_gas_price` corresponds to the cost of execution on L2
- `l2_gas_used` corresponds to the amount of gas used on L2
- `l1Fee` corresponds to the data availibity and validity proof costs on L1