Skip to content

Instantly share code, notes, and snippets.

Avatar

Hart Lambur hlambur

  • New York
View GitHub Profile
@hlambur
hlambur / uniswap-post-mortem.md
Last active Apr 30, 2020
Post Mortem: explanation of delay in initial funding of UMA liquidity pool
View uniswap-post-mortem.md

Post Mortem: explanation of delay in initial funding of UMA liquidity pool

At 15:00 UTC on Wednesday, April 29th UMA intended to supply 2MM $UMA Tokens and 2550 ETH to seed liquidity for the $UMA token liquidity pool on Uniswap.

At 14:56:36 UTC, another contract self-destructed and sent 0.01 ETH to the Uniswap pool; this was an unexpected behavior. The Uniswap smart contract correctly handles this edge case for the initial pool funding. However, the Uniswap frontend did not handle this edge case. (The frontend edge case has since been reported as a known issue).

Out of an abundance of c

@hlambur
hlambur / SFPoops.js
Last active Nov 10, 2019
Retrieves the last 1000 days of SF poop data.
View SFPoops.js
const fetch = require("node-fetch");
const getJson = async url => {
const response = await fetch(url);
const json = await response.json();
if (!json) {
throw `Query [${url}] failed to get JSON`;
}
return json;
};
@hlambur
hlambur / OptimisticBilateral.sol
Created Jul 27, 2019
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.5.1+commit.c8a2cb62.js&optimize=false&gist=
View OptimisticBilateral.sol
pragma solidity >=0.4.22 <0.6.0;
import 'https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/math/Math.sol';
contract ExampleOracle {
function submitDataRequest(address contractAdress, bytes32 priceTicker, uint disputeTimestamp) public {
// logic goes here.
}
function getDataRequest(address contractAdress) public returns (int) {
You can’t perform that action at this time.