Skip to content

Instantly share code, notes, and snippets.

View QEDK's full-sized avatar
⛓️
building

qedk QEDK

⛓️
building
View GitHub Profile
@QEDK
QEDK / risc-zero-stark-to-snark-prover_attestation.log
Created April 10, 2024 16:24
Attestation for RISC Zero STARK-to-SNARK Prover MPC Phase 2 Trusted Setup ceremony
Hey, I'm QEDK-1272002 and I have contributed to the RISC Zero STARK-to-SNARK Prover MPC Phase2 Trusted Setup ceremony.
The following are my contribution signatures:
Circuit # 1 (stark_verify)
Contributor # 44
Contribution Hash: 4fd4a580 2e1c0b5a c2277e31 aa84ff9c
a75e9be0 5ab169e2 80df26e8 5e31e829
9d65748b a28dd646 20194f1b 234afefb
29aff431 d2c94032 7b9a1773 b45dcd3a
@QEDK
QEDK / fcov.txt
Last active December 21, 2023 11:26
Forge coverage alias
alias fcov="forge coverage --report lcov && genhtml -o coverage lcov.info --ignore-errors category,category --branch-coverage && open coverage/index.html"
@QEDK
QEDK / merkle.rs
Last active September 17, 2023 17:38
Rust Merkle benchmarking
use binary_merkle_tree::merkle_root;
use fake::{Fake, Faker};
use rs_merkle::{Hasher, MerkleTree};
use sha3::{Digest, Keccak256};
use sp_core::H256;
#[derive(Clone)]
pub struct KeccakAlgorithm {}
impl Hasher for KeccakAlgorithm {
@QEDK
QEDK / Evens.sol
Created July 5, 2023 01:01
Evens contract
// SPDX-License-Identifier: AGPL-3.0
pragma solidity 0.8.20;
contract Evens {
function getEvens(uint256 startNum, uint256 endNum) external pure returns (uint256) {
assembly("memory-safe") {
// skip first iteration if startNum is 0
if iszero(startNum) { startNum := add(startNum, 1) }
endNum := add(endNum, 1)
let num := 0
@QEDK
QEDK / basefee.js
Created January 12, 2022 09:06
Mumbai EIP1559 22640000 - 22658574, 23799300 - 23800369
const { ethers } = require('ethers')
const fs = require('fs/promises')
const main = async () => {
const provider = new ethers.providers.JsonRpcProvider('https://polygon-mumbai.infura.io/v3/...')
const latestBlock = await provider.getBlock()
let totalFees = 0
let nextBaseFee = 9
await fs.appendFile('/Users/qedk/dump2.csv', 'blockNumber,baseFee,fees\n')
for (let i = 23799300; i <= latestBlock.number; i++) {
@QEDK
QEDK / DecodeStateSynced.js
Last active August 10, 2021 13:37
DecodeStateSynced.js
const ethers = require('ethers')
const abiCoder = new ethers.utils.AbiCoder()
// DEPOSIT
let data = '0x000000000000000000000000BFDEFCD92335B22B205BB5B63B9EC909D6E99C16000000000000000000000000D0DDBAB3BD60E591C300B2E365D732D9CE76D3FD0000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000014087A7811F4BFEDEA3D341AD165680AE306B01AAEACC205D227629CF157DD9F821000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000E00000000000000000000000002E274FBE47C0CB873F327362B8959021830DC886000000000000000000000000920E938A80FA1669B608166741EEB01DE6C57402000000000000000000000000920E938A80FA1669B608166741EEB01DE6C5740200000000000000000000000000000000000000000000000AD78EBC5AC620000000000000000000000000000000000000000000000000000000000000000000A000000000000000000000000000000000000000000000000000000000000000031234560000000000000000000000000000000000000000000000000000000000'
let stateSyncData = a
const matic_raw = require("./maticjs")
const config = require("./config.json")
const ext_mngr = require("./maticjs/lib/common/ExitManager")
// console.log(ext_mngr)
const root_chain = require("./maticjs/lib/root/RootChain.js")
// console.log(root_chain)
const { default: ExitManager } = require("./maticjs/lib/common/ExitManager")
const { default: RootChain } = require("./maticjs/lib/root/RootChain.js")
const params = {
network: "testnet",
// File: @0x/contracts-exchange-libs/contracts/src/LibConstants.sol
/*
Copyright 2018 ZeroEx Intl.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
@QEDK
QEDK / choices.json
Last active October 26, 2020 06:50
The Road Not Taken
[
{
"A homeless man tries to steal your wallet, should you get it back?":[
{
"Let him have it, your mom taught you that sharing is good.":[
{
"He runs away with your wallet.":[
"continue",
-10,
-5
@QEDK
QEDK / eafp.py
Last active August 27, 2020 21:03
EAFP approach
try:
def gsoc():
page = self.config["pages"]["gsoc"]
stream = self.config["streams"]["gsoc"]
self.client.send_message({
"type": message_type,
"topic": topic,
"to": destination,
"content": f"{greeting} {self.replies['gsoc'].format(page=page, stream=stream)}"
})