Skip to content

Instantly share code, notes, and snippets.

View d10r's full-sized avatar

Didi d10r

View GitHub Profile
@d10r
d10r / ERC20x.md
Last active February 14, 2025 18:22
ERC20x draft proposal

About

This is a modular proposal for the ERC20x EVM token Standard which extends ERC20.

Modules:

  • Primitives:
    • transfer to 1 (covered by ERC20. We add a variant which is allowed to invoke hooks)
    • flow to 1
    • transfer to n
    • flow to n
@d10r
d10r / sf-deploy.sh
Last active February 14, 2025 09:55
#!/bin/bash
# Script for deploying nodejs applications to the SF cloud ™.
# Requirements:
# - ssh access
# - application name in package.json or provided as env var APP_NAME
# - git url in package.json or provided as env var GIT_URL
# - package-lock.json
# - npm scripts "build" and "start"
# Optional:
@d10r
d10r / SUP.sol
Created January 8, 2025 16:40
Superfluid Token
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.23;
/* Openzeppelin Contracts */
import { ERC20 } from "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import { ERC20Permit, Nonces } from "@openzeppelin/contracts/token/ERC20/extensions/ERC20Permit.sol";
import { ERC20Votes } from "@openzeppelin/contracts/token/ERC20/extensions/ERC20Votes.sol";
/**
* @title Superfluid Token Contract
#!/bin/bash
# Queries the native coin amount deposited for a given account with a paymaster.
# Requires cast and python installed
set -eu
#set -x
# Check if exactly two arguments are provided
if [ "$#" -ne 3 ]; then
echo "Usage: $0 <network> <account_address> <threshold_in_ether>"
set -eux
# prerequisites: "forge" installed and in PATH, see https://book.getfoundry.sh/getting-started/installation
name=$1
mkdir $name
cd $name
forge init --no-commit
@d10r
d10r / gist:19cafec27da590eb9ce81cb728625e46
Created February 28, 2024 17:48
deploy-sferp-nft.sh
#!/bin/bash
# deploys an instance of GdaNFTContract to a given network
# usage: deploy.sh <network> <priceMillis>
# env var PRIVKEY needs to be set
# env var <explorer>_API_KEY needed for verification
# env vars can be provided via .env file
set -eu
#!/bin/bash
# queries the balance (of native coins, e.g. ETH) of a given account at a given block
# requires an archive node if the block lies more than a couple of blocks in the past
#
# Requirements: python, jq, curl and awk installed and in PATH
#
# usage: get-eth-balance-of-at.sh <ethereum_address> [block_number]"
# env var RPC must be set
@d10r
d10r / batch_5_200.json
Created August 22, 2023 12:16
Safe TX builder json file with 200 txs
{
"version": "1.0",
"chainId": "5",
"createdAt": "1692706453217",
"meta": {
"name": "Superfluid VestingScheduler Transactions Batch",
"description": "",
"txBuilderVersion": "1.16.1",
"createdFromSafeAddress": "",
"createdFromOwnerAddress": "",
{
"schema-version": "1",
"name": "sentinel-threshold",
"networks": {
"137": {
"comment": "Polygon: USDCx 0.01/month",
"thresholds": [{
"address": "0xCAa7349CEA390F89641fe306D93591f87595dc1F",
"above": "3858024691"
}]
@d10r
d10r / hdkeys.js
Created February 5, 2022 21:35
exploring HD key derivation
/*
BIP32 - Hierarchical Deterministic Wallet defines the semantics of a derivation path
This is some examples for paths mapped to Ethereum addresses
0 invalid (must start with m)
m 0x9b4aeeec68a20e186e98a404312869ff3330eac3
m' 0x9b4aeeec68a20e186e98a404312869ff3330eac3 (there's only 1 master)
m/ invalid
m/0 0x80e76859d6615e17c3fef155903fa9062c7bacc7 - this is the default account (child 0)