This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
0: calldatasize | |
1: iszero | |
2: push2 0x006c | |
5: jumpi | |
6: push1 0x00 # https://www.4byte.directory/signatures/?bytes4_signature=0x00000000 | |
8: dup1 | |
9: dup1 | |
a: calldataload | |
b: push1 0xe0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const eventFilterv5WithPagination = (contractAddress, erc20abi, _provider, numberOfResponses) => { | |
// creating the interface of the ABI | |
const iface = new ethers.utils.Interface(erc20abi.abi); | |
// intialize array for the logs | |
let logs = []; | |
// get latest block number | |
const latest = await provider.getBlockNumber(); | |
// intialize a counter for which block we're scraping starting at the most recent block | |
let blockNumberIndex = latest; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# work in progress/untested - use at your own risk | |
# ASSUMES ROOT | |
# installs | |
apt update && apt install wget ufw | |
# setup user | |
USERNAME=ipfs | |
adduser --system --group ${USERNAME} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# use at your own risk since I'm not very experienced at this | |
# ASSUMING YOU ARE ROOT | |
# This script assumes prior usage of the Lighthouse install script | |
# It assumes that you've already created the user and activated the firewall, etc. | |
# Install needed stuff and useful stuff | |
apt update && apt install -y git build-essential curl libclang-dev pkg-config |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# modified from https://gist.github.com/quickchase/0a1145ba42ffa414fd06f27234a50eac | |
# use at your own risk since I am not very experienced at this | |
# ASSUMING YOU ARE ROOT | |
# Install needed stuff | |
apt update && apt install -y wget ufw bash-completion htop net-tools | |
# Turn on a firewall, open the peering port | |
ufw allow ssh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# modified from https://gist.github.com/quickchase/c3d0c53213b16af6b9e4c509eb94fc4b | |
# use at your own risk since I'm not very experienced at this | |
# ASSUMING YOU ARE ROOT | |
# This script assumes prior usage of the Lighthouse install script | |
# It assumes that you've already created the user and activated the firewall, etc. | |
# Install needed stuff and useful stuff | |
apt update && apt install -y git build-essential |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const eventFilter = (contractAddress, contractAbi, eventName, _provider) => { | |
const provider = _provider | |
// this will return an array with an object for each event | |
const events = contractAbi.abi.filter(obj => obj.type ? obj.type === "event" : false); | |
// getting the Transfer event and pulling it out of its array | |
const event = events.filter(event => event.name === eventName)[0]; | |
// getting the types for the event signature | |
const types = event.inputs.map(input => input.type) | |
// knowing which types are indexed will be useful later | |
let indexedInputs = []; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// SPDX-License-Identifier: MIT | |
pragma solidity 0.8.15; | |
// current thinking is that the original was compiled on 0.5.0 or 0.5.1 | |
// after seeing significant code reuse from DSProxy, assumptions have been made | |
// the presence of cache() and setCache() imply usage of DSProxyCache | |
interface DSProxyCache { | |
function read(bytes memory _code) external view returns (address); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// SPDX-License-Identifier: MIT | |
pragma solidity ^0.8.11; | |
/** | |
* INSTRUCTIONS: | |
* make sure you have a gas profiler set up | |
* you'll also need BitMaps from OpenZeppelin | |
* run a test/script that hits the functions and profiles gas | |
* there's a typescript file with Hardhat tests included | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Contract, Provider } from "ethers-multicall"; | |
import { ethers } from 'ethers'; | |
import { JsonFragment } from "@ethersproject/abi"; | |
import { crvAbi } from './abis/crv'; | |
import * as wstEthAbi from './abis/wsteth.json'; | |
import * as yAbi from './abis/yAbi.json'; | |
import * as erc20Abi from "../artifacts/@openzeppelin/contracts/token/ERC20/IERC20.sol/IERC20.json" | |
const provider = new ethers.providers.AlchemyProvider("mainnet", process.env.ALCHEMY_API); |
NewerOlder