Skip to content

Instantly share code, notes, and snippets.

Open this in zkREPL →

This file can be included into other zkREPLs with include "gist:aa82c6d9324baa1aaaf41ebd4966d912";

@nalinbhardwaj
nalinbhardwaj / tester.circom
Last active May 23, 2022 11:11
Minimal bug tester for circom known/unknown analysis panic: https://github.com/iden3/circom/pull/57
pragma circom 2.0.3;
template TestEllipticCurveScalarMultiplyUnequal(n, k, b, x, p){
signal input in[2][k];
signal output out[2][k];
var Bits[250];
var BitLength;
for (var i = 0; i < 250; i++) {
Bits[i] = (x >> i) & 1;
@nalinbhardwaj
nalinbhardwaj / TinyCampfire.json
Last active April 17, 2022 14:07
exgrasia tile contract ABIs
[
{
"inputs": [
{
"internalType": "contract TinyWorld",
"name": "_connectedWorld",
"type": "address"
}
],
"stateMutability": "nonpayable",
@nalinbhardwaj
nalinbhardwaj / plugin.js
Last active April 12, 2022 20:37
exgrasia Inventory Plugin
import BigNumber from "https://cdn.skypack.dev/bignumber.js";
class Plugin {
name = "Inventory";
description =
"Displays owned ERC20 and ERC721 that are enumerable + in tiles right now";
FETCH_OWNED_TOKEN_BASE_URL =
"https://api-kovan-optimistic.etherscan.io/api?module=account&action=tokentx&startblock=0&endblock=999999999&sort=asc&apikey=YourApiKeyToken&address=";
FETCH_TOKEN_BALANCE_BASE_URL =
"https://api-kovan-optimistic.etherscan.io/api?module=account&action=tokenbalance&tag=latest&apikey=YourApiKeyToken&contractaddress=";
@nalinbhardwaj
nalinbhardwaj / TestTileContract.json
Last active April 12, 2022 03:28
exgrasia abi testing
[
{
"inputs": [],
"name": "logger",
"outputs": [
{ "internalType": "string", "name": "", "type": "string" },
{
"components": [
{ "internalType": "uint256", "name": "x", "type": "uint256" },
{ "internalType": "uint256", "name": "y", "type": "uint256" }
@nalinbhardwaj
nalinbhardwaj / address-map.json
Last active March 17, 2022 20:01
exgrasia Farcaster Plugin
{
"0x75667BB83190C19de669295B10068144B51a6fA9": "0x6C78aa86cf5E66C34bD606F88C0B7C0beA46202B",
"0x429C21AF8f474A29de3d3d590224fdca80233CC2": "0x5AefdB86Bd51FCe9FA56369d3136177281b9A743",
"0x78AB747D6675AB1dfeE31D0BfB6862124565AefC": "0xE2e903BbFF82EDAb2586f4c52107B6B6731fB0E2",
"0x632E7E4716394dB3DA527F4f0D979E3d60E5F9a7": "0xE981d801bb2eEe3EfB47978B7e6158133FfC7525",
"0xDC40CbF86727093c52582405703e5b97D5C64B66": "0xfdaad7289343213fb7f64f66418255b5Be3115e4",
"0xC2BAF6CdBEebE932d545DfB1802c81f721432566": "0x543c0713F0e530A622412D54fc61d5D4141310D9",
"0xEddEB70d30032f3c18e6bD13319c2363fd2b3ed6": "0xf1398F981CA91DF3Fb42a37C897ED103DdE39288",
"0x4dfdA666CcE4b0f26C49900Ded45f42F705398C7": "0xdB4a5fe3e7143B6F4ceDbE5F9387827740366343",
"0x197654927B536CB58ec0Ba369AE0047E4Dcf6e01": "0x8229379F386a3A4D652C10E9a37D1DE53F605d6b",
@nalinbhardwaj
nalinbhardwaj / plugin.js
Last active March 7, 2022 07:46
testing exgrasia frontend plugins
class Plugin {
constructor() {
this.yo = 1;
}
async render(coords) {
console.log('gm', gm);
return {__html: 'hello from the <b>other</b> side'};
}
@nalinbhardwaj
nalinbhardwaj / README.md
Last active March 3, 2022 22:23
Spotify Commentary Skipper

Setup:

  1. Put skipper.scpt in any location you like
  2. Put com.nibnalin.SpotifyCommentarySkipper.plist in ~/Library/LaunchAgents: remember to replace the path for the skipper script. Note that this needs to be an absolute path for some unknown reason, so use the full path.
@nalinbhardwaj
nalinbhardwaj / about_zkrepl.md
Last active January 31, 2022 07:38
testing circom zkrepl

Open this in zkREPL →

This file can be included into other zkREPLs with include "gist:e8d4799958f1d425f56c7ca21acc066e";

{
"_format": "hh-sol-artifact-1",
"contractName": "WordLinesToken",
"sourceName": "contracts/WordLinesToken.sol",
"abi": [
{
"inputs": [],
"stateMutability": "nonpayable",
"type": "constructor"
},