Skip to content

Instantly share code, notes, and snippets.

View liamzebedee's full-sized avatar
™️
'drop all repos

Liam Zebedee liamzebedee

™️
'drop all repos
View GitHub Profile

Take guide.

here's a guide on how to make memes on take

Templates.

if you put text in square brackets, you make a template that others can remix.

@liamzebedee
liamzebedee / Proxy.sol
Last active January 21, 2023 05:32
A high-quality Ethereum proxy in under 100 lines of code
// SPDX-License-Identifier: LGPL-3.0-only
pragma solidity ^0.8.13;
// An implementation of a proxy.
// The proxy forwards all calls to the implementation.
// The proxy has an admin.
contract ProxyStorage {
struct ProxyStore {
address admin;
@liamzebedee
liamzebedee / dappnet-history.md
Created December 3, 2022 23:39
Dappnet development history

There are a lot of details that went into Dappnet:

  • using the Cloudflare and Fleek IPFS gateways, and racing requests to them. But then they were rate-limiting us.
  • so I ran a local ipfs node. And then sent requests to that.
  • it worked for kwenta, but it wouldn't load uniswap.
  • turns out uniswap uses different standards for ENS content hashes.
  • lots of knowledge hidden here
// 1 ----- trace commitment -------------------------------------------------------------------
// Read the commitments to evaluations of the trace polynomials over the LDE domain sent by the
// prover. The commitments are used to update the public coin, and draw sets of random elements
// from the coin (in the interactive version of the protocol the verifier sends these random
// elements to the prover after each commitment is made). When there are multiple trace
// commitments (i.e., the trace consists of more than one segment), each previous commitment is
// used to draw random elements needed to construct the next trace segment. The last trace
// commitment is used to draw a set of random coefficients which the prover uses to compute

The Dappnet.

The Dappnet is a permissionless application network that can't be taken down.

The Dappnet is a combination of technologies - ENS as a permissionless name infrastructure, IPFS as a hypermedia protocol (like HTTP) and P2P CDN, and the browser as the application platform.

How do I publish?

Here's what you'll need:

@liamzebedee
liamzebedee / bench.cairo
Created September 1, 2022 12:29
Benchmark Cairo pedersen hashes (hash2)
%builtins output pedersen range_check
from starkware.cairo.common.cairo_builtins import HashBuiltin
from starkware.cairo.common.hash import hash2
func main{
output_ptr : felt*,
pedersen_ptr : HashBuiltin*,
range_check_ptr,
}():
{"publicInput":["0","26489296750625044728650904214914628343655728054935943873687351046754140865381","1","1","1","0","0","1","0","0","0","1","1","0","0","0","1","1","0","1","1","1","0","0","1","1","0","1","0","0","0","0","0","0","1","1","1","1","0","1","1","1","1","1","1","0","1","1","0","0","0","1","1","0","1","1","1","1","1","0","1","0","0","0","1","1","1","0","1","0","1","1","1","1","1","1","1","1","1","1","1","1","0","1","1","1","1","0","1","1","0","0","0","0","0","1","1","0","0","0","0","1","1","0","1","1","0","1","1","1","1","1","0","0","1","0","0","0","0","0","1","1","0","0","0","1","0","0","1","0","0","1","1","1","1","1","1","0","1","1","0","1","1","0","1","0","1","0","1","1","1","0","0","0","1","1","0","1","0","0","0","1","1","1","1","1","1","1","0","1","1","1","0","1","1","0","1","1","0","0","0","1","0","0","0","0","0","1","0","0","0","0","0","0","1","0","0","0","0","0","1","0","1","1","0","1","1","0","1","1","1","1","0","1","0","0","1","1","0","0","1","1","0","1","1","1","0","0","0","1","0","1","1",
import {
SelfProof,
Field,
ZkProgram,
verify,
Poseidon,
SmartContract,
Scalar,
arrayProp,
} from 'snarkyjs';
import { SelfProof, Field, ZkProgram, verify, Poseidon, SmartContract, Scalar, arrayProp } from 'snarkyjs';
import {
CircuitValue,
prop,
Signature,
PrivateKey,
PublicKey,
} from 'snarkyjs';
import { SelfProof, Field, ZkProgram, verify, Poseidon, SmartContract, Scalar, arrayProp } from 'snarkyjs';
import {
Circuit,
CircuitValue,
prop,
public_,
circuitMain,
Signature,
PrivateKey,
PublicKey,