title | published | description | tags |
---|---|---|---|
Privacidad sin ZK ¿Es posible a puro Solidity? |
false |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ 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) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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]); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6027600D60003960276000F3FE7F00000000000000000000000000000000000000000000000000000000000000105F5260205FF3 |
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,
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |