Skip to content

Instantly share code, notes, and snippets.

View johhonn's full-sized avatar

John johhonn

View GitHub Profile
const NETWORK = "";
const BOX_ADDRESS = "0x4ae57798aef4af99ed03818f83d2d8aca89952c7";
const PIZZA_ADDRESS = "0xe6616436ff001fe827e37c7fad100f531d0935f0";
const MULTISIG_ADDRESS = "0xBA5E28a2D1C8cF67Ac9E0dfc850DC8b7b21A4DE2";
const BOX_ABI = [
{
anonymous: false,
inputs: [
{
indexed: true,
// Sources flattened with hardhat v2.9.1 https://hardhat.org
// File contracts/interfaces/ISemaphoreCore.sol
//SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.8.4;
/// @title SemaphoreCore interface.
/// @dev Interface of SemaphoreCore contract.
interface ISemaphoreCore {
/** This example code is designed to quickly deploy an example contract using Remix.
* If you have never used Remix, try our example walkthrough: https://docs.chain.link/docs/example-walkthrough
* You will need testnet ETH and LINK.
* - Kovan ETH faucet: https://faucet.kovan.network/
* - Kovan LINK faucet: https://kovan.chain.link/
*/
pragma solidity ^0.6.7;
import "https://github.com/smartcontractkit/chainlink/blob/master/evm-contracts/src/v0.6/interfaces/AggregatorV3Interface.sol";
{
"name": "DFITestList",
"logoURI": "https://defiprime.com/images/defiprime-logo-hires2.png",
"keywords": ["Defi"],
"tags": {
"defi": {
"name": "DeFi Token",
"description": "Test Token List"
}
},
@johhonn
johhonn / gist:ff3e8fb62a8aff6100f7fcbac6a802cd
Created November 17, 2020 03:52
uniswap-oracle-sdk example
// happy coding 👻
import * as OracleSdk from '@keydonix/uniswap-oracle-sdk'
import * as OracleSdkAdapter from '@keydonix/uniswap-oracle-sdk-adapter'
import Web3 from 'web3'
require('dotenv').config()
type JsonRpcObject = { jsonrpc: '2.0', id: number | string | null, method: string, params?: unknown[] | object }
type SendAsyncProvider = { sendAsync: (request: JsonRpcObject, callback: (error: unknown, result: unknown) => void) => Promise<unknown> }
type RequestProvider = { request: (method: string, params?: unknown[] | object) => Promise<unknown> }
type Provider = SendAsyncProvider | RequestProvider
let URL=process.env.INFURA as string
[
{
"constant": false,
"inputs": [
{
"name": "_requestId",
"type": "bytes32"
},
{
"name": "_price",
import React, { Component } from 'react'
import PropTypes from 'prop-types'
import classNames from 'classnames'
import { withStyles } from '@material-ui/core/styles'
import Typography from '@material-ui/core/Typography'
import Fab from '@material-ui/core/Fab'
import AddIcon from '@material-ui/icons/Add'
import Grid from '@material-ui/core/Grid'
import Paper from '@material-ui/core/Paper'
import Button from '@material-ui/core/Button'
<html>
<head>
<title>BIP39 Mnemonic</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<script type="text/javascript">
"use strict";var sjcl={cipher:{},hash:{},keyexchange:{},mode:{},misc:{},codec:{},exception:{corrupt:function(a){this.toString=function(){return"CORRUPT: "+this.message};this.message=a},invalid:function(a){this.toString=function(){return"INVALID: "+this.message};this.message=a},bug:function(a){this.toString=function(){return"BUG: "+this.message};this.message=a},notReady:function(a){this.toString=function(){return"NOT READY: "+this.message};this.message=a}}};
sjcl.cipher.aes=function(a){this.s[0][0][0]||this.O();var b,c,d,e,f=this.s[0][4],g=this.s[1];b=a.length;var h=1;if(4!==b&&6!==b&&8!==b)throw new sjcl.exception.invalid("invalid aes key size");this.b=[d=a.slice(0),e=[]];for(a=b;a<4*b+28;a++){c=d[a-1];if(0===a%b||8===b&&4===a%b)c=f[c>>>24]<<24^f[c>>16&255]<<16^f[c>>8&255]<<8^f[c&255],0===a%b&&(c=c<<8^c>>>24^h<<24,h=h<<1^283*(h>>7));d[a]=d[a-b]^c}f