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
use ingot::evm
use ingot::codec::{ Cursor, Encode, Decode }
use ingot::evm::{ MemBuffer }
use ingot::mydefault::{ MyDefault }
use ingot::option::{ Option }
// Constants for the hash table
const TABLE_SIZE: usize = 32 // Fixed size table
const EMPTY: u256 = 0
const DELETED: u256 = 1
@Turupawn
Turupawn / fe jam 5 de mayo
Created May 6, 2025 18:19
fe jam 5 de mayo
use ingot::codec::{Encode, Decode}
use ingot::operators::{Add, Sub, AddAssign, SubAssign}
use ingot::default::{Default}
pub trait Hasher {
type Output
fn hash<T: Encode>(mut self, key: T) -> Self::Output
}
impl Hasher for Sha1 {
@Turupawn
Turupawn / run.bash
Created May 2, 2025 18:58
Error trying to install vs code language server
$ cargo install --git https://github.com/ethereum/fe.git fe-language-server
Updating git repository `https://github.com/ethereum/fe.git`
Installing fe-language-server v0.26.0 (https://github.com/ethereum/fe.git#72622894)
Updating crates.io index
Updating git repository `https://github.com/micahscopes/async-lsp`
Updating git repository `https://github.com/salsa-rs/salsa`
Locking 265 packages to latest compatible versions
Adding codespan-reporting v0.11.1 (available: v0.12.0)
Adding cranelift-entity v0.115.1 (available: v0.119.0)
Adding derive_more v1.0.0 (available: v2.0.1)
@Turupawn
Turupawn / commit_reveal.sol
Created April 21, 2025 15:50
Commit-Reveal simple en Solidity
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.22;
// Contrato ejemplo de esquema commit-reveal
// Consiste en el juego de "Adivina cuál número del 0 al 10 estoy pensando"
contract SimpleNumberGuess {
// Hash commitment of the secret number (capped via modulo 11)
bytes32 public numberCommitment;
// Flag que indica si el número ya fué revelado
bool public revealed;
@Turupawn
Turupawn / valiste_verga.md
Created April 20, 2025 17:44
valiste verga
title published description tags
Privacidad sin ZK ¿Es posible a puro Solidity?
false
@Turupawn
Turupawn / merkle_proof.nr
Created April 16, 2025 18:24
Merkle Inclusion Proofs in Noir
use std::hash::pedersen_hash;
fn main(root : pub Field,
index : Field,
hash_path : [Field; 2],
secret: Field, priv_key: Field,
public_param1: pub Field,
public_param2: pub Field) -> pub Field
{
let note_commitment = pedersen_hash([priv_key, secret]);
6027600D60003960276000F3FE7F00000000000000000000000000000000000000000000000000000000000000105F5260205FF3
@Turupawn
Turupawn / bash.md
Last active April 1, 2025 19:56
Verifying locally

services/server/src/config/default.js

...
  storage: {
    // read option will be the "source of truth" where the contracts read from for the API requests.
    read: RWStorageIdentifiers.RepositoryV1, // CHANGED HERE
    // User request will NOT fail if saving to these fail, but only log a warning
    writeOrWarn: [
      WStorageIdentifiers.RepositoryV2, // CHANGED HERE
      RWStorageIdentifiers.RepositoryV1,
@Turupawn
Turupawn / ERC20.fe
Created March 26, 2025 17:58
fe jam mar 26
use ingot::evm
use ingot::solidity
contract ERC20 {
pub balance: solidity::Mapping<evm::Address, u256>,
pub allowance: solidity::Mapping<(evm::Address, evm::Address), u256>,
pub TOTAL_SUPPLY: u256,
pub NAME: String<20>,
pub SYMBOL: String<5>,
pub DECIMALS: u8
@Turupawn
Turupawn / dummy.py
Last active March 25, 2025 05:28
ezkl locally
# Verifica si el notebook está en Colab
try:
# Instala ezkl y onnx si estás en Colab
import google.colab
import subprocess
import sys
subprocess.check_call([sys.executable, "-m", "pip", "install", "ezkl"])
subprocess.check_call([sys.executable, "-m", "pip", "install", "onnx"])
except:
pass # Si no, usa tu setup de ezkl local