Skip to content

Instantly share code, notes, and snippets.

View apehex's full-sized avatar

David apehex

  • ~~~~~~~~*\o/~~~~~/\*~~~~~~~
View GitHub Profile
@hungdoansy
hungdoansy / main.ts
Created July 5, 2022 06:02
Call a contract method at a specific block using ethers.js
// Example of using ethers.js to interact with a smart contract
// Call a contract method at a specific block
// This example is to get rate of a token at a block
import { ethers } from "ethers"
import BigNumber from "bignumber.js"
// prettier-ignore
const oracleABI = '[{"inputs":[{"internalType":"contract MultiWrapper","name":"_multiWrapper","type":"address"},{"internalType":"contract IOracle[]","name":"existingOracles","type":"address[]"},{"internalType":"enum OffchainOracle.OracleType[]","name":"oracleTypes","type":"uint8[]"},{"internalType":"contract IERC20[]","name":"existingConnectors","type":"address[]"},{"internalType":"contract IERC20","name":"wBase","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"contract IERC20","name":"connector","type":"address"}],"name":"ConnectorAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"contract IERC20","name":"connector","type":"address"}],"name":"
@spicycode
spicycode / tmux.conf
Created September 20, 2011 16:43
The best and greatest tmux.conf ever
# 0 is too far from ` ;)
set -g base-index 1
# Automatically set window title
set-window-option -g automatic-rename on
set-option -g set-titles on
#set -g default-terminal screen-256color
set -g status-keys vi
set -g history-limit 10000