Skip to content

Instantly share code, notes, and snippets.

@0age
0age / Seaport.json
Last active February 18, 2024 05:18
Seaport 1.4 ABI
[
{
"inputs": [
{
"components": [
{
"internalType": "address",
"name": "offerer",
"type": "address"
},
@z0r0z
z0r0z / Multisig.sol
Last active March 9, 2022 01:50
Simple gas-optimized multi-signature contract.
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity >=0.8.4;
/// @notice Simple gas-optimized multi-signature contract.
contract Multisig {
event Propose(address indexed proposer, uint256 indexed proposal);
event Sign(address indexed signer, uint256 indexed proposal);
event Execute(uint256 indexed proposal);
error NotSigner();
pragma solidity 0.4.19;
import { SafeMath } from "zeppelin-solidity/contracts/math/SafeMath.sol";
import { ERC20 } from "zeppelin-solidity/contracts/token/ERC20/ERC20.sol";
import { Exchange } from "../shared/Exchange.sol";
import { Proxy } from "../shared/Proxy.sol";
import { MathHelpers } from "../lib/MathHelpers.sol";
/**
* @title CoveredOption
@miguelmota
miguelmota / multicall.go
Created June 12, 2021 01:10
Golang MultiCall solidity contract call example
package main
import (
"context"
"encoding/hex"
"fmt"
"strings"
"github.com/ethereum/go-ethereum"
"github.com/ethereum/go-ethereum/accounts/abi"
@spalladino
spalladino / Loans.sol
Created March 20, 2021 16:57
Strawman for flashloans for flashbots
pragma solidity ^0.7.0;
// Each mining pool that intends to provide flash loans deploys a Loaner contract and transfers ETH to it
// When testing each bundle, the diff in balance in this contract is taking into account for calculating effective gas price
// The contract loans funds only on blocks mined by the miner and on zero-gasprice txs
contract Loaner {
address immutable owner;
constructor(address _owner) {
owner = _owner;
@yorickdowne
yorickdowne / README.md
Last active April 11, 2023 08:31
Verify a public GPG signature - example Lighthouse

Eh?

So a FOSS project might have signed releases with a GPG sig. How do you verify it on a Linux machine?

Example sigp/lighthouse, but same idea for any project.

Install gpg: sudo apt install gpg

Grab their PGP key ID from their download page and gpg --keyserver pgp.mit.edu --recv THEIRKEYID and wait

@cryptoscopia
cryptoscopia / dydxFlashLoanTemplate.sol
Created October 21, 2020 06:42
A single-file simplest possible template for a contract that obtains a flash loan from dydx, does things, and pays it back.
// SPDX-License-Identifier: AGPL-3.0-or-later
// The ABI encoder is necessary, but older Solidity versions should work
pragma solidity ^0.7.0;
pragma experimental ABIEncoderV2;
// These definitions are taken from across multiple dydx contracts, and are
// limited to just the bare minimum necessary to make flash loans work.
library Types {
enum AssetDenomination { Wei, Par }
#!/bin/bash
###
### my-script — does one thing well
###
### Usage:
### my-script <input> <output>
###
### Options:
### <input> Input file to read.
### <output> Output file to write. Use '-' for stdout.
@gaearon
gaearon / Classes.js
Created May 27, 2020 17:38
Beneath Classes: Prototypes
class Spiderman {
lookOut() {
alert('My Spider-Sense is tingling.');
}
}
let miles = new Spiderman();
miles.lookOut();