Skip to content

Instantly share code, notes, and snippets.

View coffeexcoin's full-sized avatar

Coffee ☕️ coffeexcoin

View GitHub Profile
@coffeexcoin
coffeexcoin / Dockerfile
Created August 4, 2023 16:46
create2crunch dockerfile
FROM nvidia/opencl
SHELL ["/bin/bash", "-c"]
RUN apt update
RUN apt install -y build-essential ocl-icd-opencl-dev git curl
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | bash -s -- -y
RUN git clone --depth 1 https://github.com/0age/create2crunch
WORKDIR /create2crunch
RUN source $HOME/.cargo/env && cargo build --release
#Keyless Create2
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (proxy/ERC1967/ERC1967Proxy.sol)
pragma solidity ^0.8.20;
import {Proxy} from "../Proxy.sol";
import {ERC1967Utils} from "./ERC1967Utils.sol";
/**
* @dev This contract implements an upgradeable proxy. It is upgradeable because calls are delegated to an
@coffeexcoin
coffeexcoin / standard-input.json
Last active November 21, 2023 18:55
OpenZeppelin V5.0 ERC1967 Proxy standard json for verification
{
"language": "Solidity",
"sources": {
"contracts/proxy/ERC1967/ERC1967Proxy.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (proxy/ERC1967/ERC1967Proxy.sol)\n\npragma solidity ^0.8.20;\n\nimport {Proxy} from \"../Proxy.sol\";\nimport {ERC1967Utils} from \"./ERC1967Utils.sol\";\n\n/**\n * @dev This contract implements an upgradeable proxy. It is upgradeable because calls are delegated to an\n * implementation address that can be changed. This address is stored in storage in the location specified by\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967], so that it doesn't conflict with the storage layout of the\n * implementation behind the proxy.\n */\ncontract ERC1967Proxy is Proxy {\n /**\n * @dev Initializes the upgradeable proxy with an initial implementation specified by `implementation`.\n *\n * If `_data` is nonempty, it's used as data in a delegate call to `implementation`. This will typically be an\n * encoded function
import { Alchemy, Network } from "alchemy-sdk";
import { Wallet, Contract, providers, utils} from "ethers";
const Contracts = {
MegaPlunk: "0x51ae7f53fA2cE21b06B89ABB5ddC83FfDB868423",
Frontlines: "0x0F9B1418694ADAEe240Cb0d76B805d197da5ae8a",
Q00tants: "0x9F7C5D43063e3ECEb6aE43A22b669BB01fD1039A"
};
async function getRektCorns() {
@coffeexcoin
coffeexcoin / flashbots.ts
Last active August 18, 2024 14:18
viem flashbots
import { Account, Address, Chain, Client, ClientConfig, createClient, Hash, Hex, http, ParseAccount, Prettify, RpcSchema, Transport } from "viem";
export type FlashbotsRpcSchema = [
/**
* @description Simulate a bundle against a specific block number, including simulating a bundle at the top of the next block.
* @link https://docs.flashbots.net/flashbots-auction/advanced/rpc-endpoint#eth_callbundle
* @example
* provider.request({ method: 'eth_callBundle', params: [ txs: ['0x...', '0x...'], blockNumber: '0x...', stateBlockNumber: '0x...' ] })
* // => { bundleGasPrice: '0x...', bundleHash: '0x...', coinbaseDiff: '0x...', ethSentToCoinbase: '0x...', gasFees: '0x...', results: [ { coinbaseDiff: '0x...', ethSentToCoinbase: '0x...', gasFees: '0x...', gasUsed: '0x...', toAddress: '0x...', txHash: '0x...', value: '0x...' } ], stateBlockNumber: '0x...', totalGasUsed: '0x...' }
*/
@coffeexcoin
coffeexcoin / flashbots2.ts
Created August 18, 2024 18:02
viem flashbots
import { Account, Address, Chain, Client, ClientConfig, createClient, createTestClient, Hash, Hex, http, ParseAccount, Prettify, RpcSchema, Transport } from "viem";
export type FlashbotsRpcSchema = [
/**
* @description Simulate a bundle against a specific block number, including simulating a bundle at the top of the next block.
* @link https://docs.flashbots.net/flashbots-auction/advanced/rpc-endpoint#eth_callbundle
* @example
* provider.request({ method: 'eth_callBundle', params: [ txs: ['0x...', '0x...'], blockNumber: '0x...', stateBlockNumber: '0x...' ] })
* // => { bundleGasPrice: '0x...', bundleHash: '0x...', coinbaseDiff: '0x...', ethSentToCoinbase: '0x...', gasFees: '0x...', results: [ { coinbaseDiff: '0x...', ethSentToCoinbase: '0x...', gasFees: '0x...', gasUsed: '0x...', toAddress: '0x...', txHash: '0x...', value: '0x...' } ], stateBlockNumber: '0x...', totalGasUsed: '0x...' }
*/