Skip to content

Instantly share code, notes, and snippets.

View veox's full-sized avatar
💭
Being skeptical of status feature.

Noel Maersk veox

💭
Being skeptical of status feature.
View GitHub Profile
@ritzdorf
ritzdorf / EIP1884.md
Last active September 27, 2022 12:03
Recently Executed Transactions affected by EIP1884

Recently Executed Contracts with Issues in EIP 1884

EIP 1884 is set to be implemented into the upcoming Ethereum 'Istanbul' hard fork. It

  • increases the cost of opcode SLOAD from 200 to 800 gas
  • increases the cost of BALANCE and EXTCODEHASH from 400 to 700 gas
  • adds a new opcode SELFBALANCE with cost 5.
@lyda
lyda / metrics.lua
Last active September 21, 2022 04:16
Prometheus node-exporter in lua for openwrt
#!/usr/bin/lua
-- Metrics web server (0.1)
-- Copyright (c) 2015 Kevin Lyda
-- Apache 2.0 License
socket = require("socket")
netsubstat = {"IcmpMsg", "Icmp", "IpExt", "Ip", "TcpExt", "Tcp", "UdpLite", "Udp"}
cpu_mode = {"user", "nice", "system", "idle", "iowait", "irq",
"softirq", "steal", "guest", "guest_nice"}
netdevsubstat = {"receive_bytes", "receive_packets", "receive_errs",

EC2 settings

  • Instance type: t2.xlarge
  • vCPUs: 4
  • Memory (GiB): 16
  • General Purpose SSD (GP2): 200 GB
  • Ubuntu
  • Running in eu-central-1b (Frankfurt)

Hint: to make your life easier and allow login with a simple ssh btc-0.14, edit ~/.ssh/config:

pragma solidity ^0.5.11;
/*
* @author Agustin Aguilar <@agusx1211>
*/
library ChunkStorage {
struct Storage {
mapping(bytes32 => address) slots;
}
```
// This code snippet shows how an external function can use a pattern like
// python's `try..except..else` with `.call`, `throw`, and reentry
contract TryExceptElsePatternUser {
address _sender;
function tryExceptElsePatternExample()
external // must be external
{
if( msg.sender == address(this) ) {
@randyklein
randyklein / config.py
Last active March 4, 2022 08:20
Simple NiceHash Monitor
#config
minProf= .001 #min profit for alert in BTC/Day
slowAlertTimer = 300 #min time for slow alert in seconds
offTimer = 0 #min time of off alert in seconds
btcAddress = "address goes here" #niceHash BTC address to monitor
iftttKey = "key goes here" #key from IFTTT Maker applet
@alexvandesande
alexvandesande / ethernalsale.js
Last active October 21, 2021 04:40
This is a first draft at what could be a continuous token sale. I just wrote it and haven't tested it but it shows the proof of concept: tokens are continuously generated in any curve desired and sold for the highest bidder. Since there's a maximum token sale speed, this guarantees that sales can't end too quickly. Since the sale always starts f…
pragma solidity ^0.4.2;
contract ethernalSale {
struct order {
uint amount;
address buyer;
}
mapping (uint => order) orderBook;
mapping (address => uint) balanceOf;
@izqui
izqui / forwarder.sol
Last active October 21, 2021 04:24
Very cheap to deploy (66k gas) forwarder contracts that can clone any contract and still have their own storage
// Bytecode origin https://www.reddit.com/r/ethereum/comments/6ic49q/any_assembly_programmers_willing_to_write_a/dj5ceuw/
// Modified version of Vitalik's https://www.reddit.com/r/ethereum/comments/6c1jui/delegatecall_forwarders_how_to_save_5098_on/
// Credits to Jordi Baylina for this way of deploying contracts https://gist.github.com/jbaylina/e8ac19b8e7478fd10cf0363ad1a5a4b3
// Forwarder is slightly modified to only return 256 bytes (8 normal returns)
// Deployed Factory in Kovan: https://kovan.etherscan.io/address/0xaebc118657099e2110c90494f48b3d21329b23eb
// Example of a Forwarder deploy using the Factory: https://kovan.etherscan.io/tx/0xe995dd023c8336685cb819313d933ae8938009f9c8c0e1af6c57b8be06986957
// Just 66349 gas per contract
@GNSPS
GNSPS / ProxyFactory.sol
Last active October 9, 2021 08:47
Improved `delegatecall` proxy contract factory (Solidity) [v0.0.5]
/***
* Shoutouts:
*
* Bytecode origin https://www.reddit.com/r/ethereum/comments/6ic49q/any_assembly_programmers_willing_to_write_a/dj5ceuw/
* Modified version of Vitalik's https://www.reddit.com/r/ethereum/comments/6c1jui/delegatecall_forwarders_how_to_save_5098_on/
* Credits to Jorge Izquierdo (@izqui) for coming up with this design here: https://gist.github.com/izqui/7f904443e6d19c1ab52ec7f5ad46b3a8
* Credits to Stefan George (@Georgi87) for inspiration for many of the improvements from Gnosis Safe: https://github.com/gnosis/gnosis-safe-contracts
*
* This version has many improvements over the original @izqui's library like using REVERT instead of THROWing on failed calls.
* It also implements the awesome design pattern for initializing code as seen in Gnosis Safe Factory: https://github.com/gnosis/gnosis-safe-contracts/blob/master/contracts/ProxyFactory.sol
#import asyncio
import logging
from flask import Blueprint, Flask, request, render_template, g
from flask_graphql import GraphQLView
from google.cloud import logging as glogging
#from graphql.execution.executors.asyncio import AsyncioExecutor
from web3 import Web3, HTTPProvider
from werkzeug.serving import run_simple
from graphql import (
graphql,