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 / fe-v2-errors.bash
Created May 24, 2025 15:48
fe-v2-errors.bash
$ ~/Projects/fe/fe-v2/target/debug/fe check .
error: unexpected token while parsing field definition
┌─ /home/irenee/Projects/fe-token-demos/master/src/ERC20.fe:5:35
5 │ pub balance: solidity::Mapping<evm::Address, u256>,
│ ^ unexpected token
= expected a newline; found symbol `<` instead
error: unexpected token while parsing field definition
@Turupawn
Turupawn / P256Verifier.sol
Created May 22, 2025 15:45
Vibecoded RIP-7212
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
contract P256Verifier {
address constant P256_PRECOMPILE = address(0x0100);
/// @notice Verifies a secp256r1 signature using the EIP-7212 precompile.
/// @param hash The 32-byte message hash that was signed.
/// @param r The 32-byte r component of the signature.
/// @param s The 32-byte s component of the signature.
@Turupawn
Turupawn / NoirGettingStarted.md
Last active May 20, 2025 21:34
Getting started with Noir: Hello World

Install the dependencies

curl -L https://raw.githubusercontent.com/noir-lang/noirup/refs/heads/main/install | bash
noirup
curl -L https://raw.githubusercontent.com/AztecProtocol/aztec-packages/refs/heads/master/barretenberg/bbup/install | bash
bbup

Create a new project

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