Skip to content

Instantly share code, notes, and snippets.

View austintgriffith's full-sized avatar
💭
:bowtie:

Austin Griffith austintgriffith

💭
:bowtie:
View GitHub Profile
let messageBuffer = {}
module.exports = (web3)=>{
let burnerWeb3 = web3
var iframe = document.createElement('iframe')
iframe.style.opacity = 0.9
iframe.style.position = "absolute"
iframe.style.width = "300px"
@austintgriffith
austintgriffith / predictivedeployment.js
Last active November 17, 2018 18:46
simple script to create a predictive deployment of a smart contract
var ethers = require('ethers');
var fs = require('fs');
var Wallet = ethers.Wallet;
//usage: node craft.js ABI_FILE BYTECODE_FILE GAS_LIMIT GAS_PRICE [...CONSTRUCTOR ARGUMENTS]
//node craft.js "../Sweeper/Sweeper.abi" "../Sweeper/Sweeper.bytecode" 250000 100000000000 (cat ../Loan/Loan.address) (cat ../SomeCoin/SomeCoin.address) 1
const wallet = ethers.Wallet.createRandom();
let httpProvider = new ethers.providers.JsonRpcProvider();
let abi = fs.readFileSync(process.argv[2]).toString()
let bytecode = fs.readFileSync(process.argv[3]).toString()
let factory = new ethers.ContractFactory(abi, bytecode, wallet);
@austintgriffith
austintgriffith / relayer.js
Last active March 6, 2024 03:00
A super simple meta transaction relayer.
"use strict";
const express = require('express');
const helmet = require('helmet');
const app = express();
const fs = require('fs');
const ContractLoader = function(contractList,web3){
let contracts = []
for(let c in contractList){
try{
let abi = require("./src/contracts/"+contractList[c]+".abi.js")
@austintgriffith
austintgriffith / Proxy.sol
Created October 26, 2018 06:35
A blind meta transaction proxy.
pragma solidity ^0.4.24;
// adapted from https://github.com/austintgriffith/bouncer-proxy/blob/master/BouncerProxy/BouncerProxy.sol
// Blind proxy - forward everything
contract Proxy {
constructor() public {}
mapping(address => uint) public nonce;
function getHash(address signer, address destination, uint value, bytes data) public view returns(bytes32){
return keccak256(abi.encodePacked(address(this), signer, destination, value, data, nonce[signer]));
}
function forward(bytes sig, address signer, address destination, uint value, bytes data) public {
Verifying my identity on Peepeth.com 0x34aa3f359a9d614239015126635ce7732c18fdf3
/*
Takes a collection of pngs layers and joins them for
https://github.com/austintgriffith/nifties-vs-nfties
brew install imagemagick
brew install graphicsmagick
npm install --save gm
node index.js
/*
Takes a collection of pngs layers and joins them for
https://github.com/austintgriffith/nifties-vs-nfties
brew install imagemagick
brew install graphicsmagick
npm install --save gm
node index.js
//May the 4th be with you
//example usage
//?difficulty=5&input=helloworld3
const express = require('express');
const helmet = require('helmet');
const fs = require('fs');
//const md5 = require('md5');
const crypto = require('crypto');
const app = express();
app.use(helmet());
<?php
//May the 4th be with you
//example usage
//?difficulty=5&input=helloworld3
if(!@$_GET["difficulty"] || !@$_GET["input"]){
echo "May the 4th be with you!";
}else{
$difficulty = $_GET["difficulty"];
$input = $_GET["input"];
$seed = trim(file_get_contents("seed.txt"));
@austintgriffith
austintgriffith / index.js
Created April 18, 2018 17:10
Create React App index.js with Service Worker disabled so it works with web3
import React from 'react';
import ReactDOM from 'react-dom';
import './index.css';
import './styles/App.css';
import App from './App';
//import registerServiceWorker from './registerServiceWorker';
import { unregister } from './registerServiceWorker';
unregister()
ReactDOM.render(<App />, document.getElementById('root'));
//registerServiceWorker();