Skip to content

Instantly share code, notes, and snippets.

View lucasmenendez's full-sized avatar
Reinventing the wheel

kacuatro lucasmenendez

Reinventing the wheel
View GitHub Profile
@lucasmenendez
lucasmenendez / failed_tx.txt
Created October 7, 2025 07:23
Simple script to decode failed tx with state transitions
0x579cea96eec9e6a96b62e9f90760bc523f26ee6f7094139c7fc316d09d0f8a37
0xc626751ed81bd7a8be981bc087f947c613ac0432d473a01472ebe794bb346c83
0xaeb756cf1821d44ff6bce76efcafaf4d4517967b029f7482763506e01c5665b5
0xd3115be28e7ade4c17e584186b2e8636930bf72a6bffa62a6f2453064f9cfd7e
0xd605249399aa43882dc5b7d6669194df022d146567ff4b3ed2f598835f861a00
0xf78e09d09ee98b0557bd4569fa800c0cb8a0f238ed5af63aeca05be0f4ee4aac
0x1dcade3b01148271fa057face3f029753930b3b38238c602595076fde3a436f7
0xcd913a0d4908f15f64e46f585a2e776205ddff89bfdf794f5d59e43405a769dd
0xda7ec14fdcd4a07c85d01a74922e25b811731b884264306a6699bf292e9a1a96
0x3f136d215ecc70a3844c2e514d6d038e18ee743b663d8c7b659d3b031c92e236
@lucasmenendez
lucasmenendez / go.mod
Created September 1, 2025 11:51
Simple golang script to vote using a CSP and Davinci Sequencer
module vote-script
go 1.24.2
require github.com/vocdoni/davinci-node v0.0.0-20250901101917-ab9f3a072310
require (
github.com/bits-and-blooms/bitset v1.22.0 // indirect
github.com/blang/semver/v4 v4.0.0 // indirect
github.com/consensys/gnark v0.13.0 // indirect
package bugtest
import (
_ "embed"
"encoding/json"
"fmt"
"testing"
"github.com/consensys/gnark/std/algebra/emulated/sw_bn254"
recursion "github.com/consensys/gnark/std/recursion/groth16"
package statetransition
import (
"testing"
"github.com/consensys/gnark-crypto/ecc"
ecc_tweds "github.com/consensys/gnark-crypto/ecc/twistededwards"
"github.com/consensys/gnark/frontend"
"github.com/consensys/gnark/std/algebra/native/twistededwards"
"github.com/consensys/gnark/test"
=== RUN TestReencryptedBallotCircuit
=== RUN TestReencryptedBallotCircuit/bn254
Error: division by zero
big.nat.div
natdiv.go:520
big.(*Int).QuoRem
int.go:293
big.(*Int).Div
int.go:304
ecc.PrecomputeLattice

Bulb Controller

These are fun. Thought I'd do another one. This one would work well as a fun interaction for a power company or construction company website.

A Pen by Lucas Menéndez on CodePen.

License.

package aggregator
import (
"log"
"math/big"
"testing"
"github.com/consensys/gnark-crypto/ecc"
"github.com/consensys/gnark/frontend"
"github.com/consensys/gnark/std/algebra/emulated/sw_bn254"
package mimc
import (
"math/big"
"github.com/consensys/gnark/std/algebra/emulated/sw_bn254"
"github.com/consensys/gnark/std/math/emulated"
)
const nRounds = 91
@lucasmenendez
lucasmenendez / listener.go
Created June 20, 2024 14:57
Dummy ERC20 listerner
package listener
import (
"context"
"fmt"
"github.com/ethereum/go-ethereum"
"github.com/ethereum/go-ethereum/accounts/abi/bind"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core/types"
@lucasmenendez
lucasmenendez / csv_to_json.py
Last active December 22, 2023 09:25
census3 ipfs census explorer
import argparse, json, csv, decimal
parser = argparse.ArgumentParser(description="Convert Etherscan holders csv to json")
parser.add_argument('-i', '--csv', help="Etherscan holders csv")
parser.add_argument('-o', '--json', help="Output json file")
args = parser.parse_args()
with open(args.csv) as f:
reader = csv.DictReader(f)