Skip to content

Instantly share code, notes, and snippets.

@jeffywu
jeffywu / gist:882111d670faaacc7a0541989bb46fb2
Created December 6, 2023 18:29
Gnosis Transaction Builder
// SPDX-License-Identifier: UNLICENSED
pragma solidity 0.8.17;
import "forge-std/Script.sol";
struct MethodCall {
address to;
uint256 value;
bytes callData;
}
@jeffywu
jeffywu / DeployAndMigrate.py
Last active June 30, 2021 14:00
NotionalV1 to Compound
import os
import json
from brownie import (
accounts,
NotionalV1ToCompound,
nTransparentUpgradeableProxy
)
from brownie.network import web3
from brownie.network.contract import Contract
@jeffywu
jeffywu / Market.ts
Created February 15, 2021 17:17
Notional Market Calculation
import {BigNumber} from 'ethers/utils';
import {Decimal} from 'decimal.js';
import {CashMarket} from './typechain/CashMarket';
import {WeiPerEther} from 'ethers/constants';
import {getNowSeconds, toBigNumber} from './utils';
import {CashGroup} from './cashGroup';
import {GraphClient, MarketQueryResult} from './graphClient';
import {ApolloQueryResult} from '@apollo/client';
/** Mimic ABDK rounding settings */
@jeffywu
jeffywu / Component.ts
Last active August 9, 2020 00:59
OnboardJS + Redux
import * as React from 'react';
import { useSelector } from 'react-redux';
import { selectOnboard, selectAccount } from '../redux/Store';
export default function ConnectWallet() {
const networkId = Number(process.env.NETWORK_ID);
const swapnet = useSelector(selectSwapnet);
const onboard = useSelector(selectOnboard);
const account = useSelector(selectAccount);
const dispatch = useDispatch();

Keybase proof

I hereby claim:

  • I am jeffywu on github.
  • I am jeffywu (https://keybase.io/jeffywu) on keybase.
  • I have a public key ASBlLB4bSMCU_b7afDAa6si2JGm3UlwYuieQnPx4wtxYFwo

To claim this, I am signing this object: