Skip to content

Instantly share code, notes, and snippets.

View YazzyYaz's full-sized avatar
💭
Coding 💻

Yaz Khoury YazzyYaz

💭
Coding 💻
View GitHub Profile
var TrademarkRegistration =
artifacts.require("./TrademarkRegistration.sol");
module.exports = function(deployer) {
deployer.deploy(TrademarkRegistration);
};
@YazzyYaz
YazzyYaz / etc-truffle-config.js
Created March 22, 2019 21:27
ETC Pre-Byzantium Truffle Configuation JSON
module.exports = {
networks: {
development: {
host: "127.0.0.1", // Localhost (default: none)
port: 8545, // Standard Ethereum port (default: none)
network_id: "*", // Any network (default: none)
}
},
compilers: {
pragma solidity 0.5.1;
contract TrademarkRegistration {
struct TradeMark {
string phrase;
string authorName;
uint256 timestamp;
bytes32 proof;
}
@YazzyYaz
YazzyYaz / gist:c21a8b8be38c76aae413576890cc2343
Created March 22, 2019 13:23
etc-smartcontract-bytecode
0x608060405234801561001057600080fd5b50610cc2806100206000396000f3fe608060405234801561001057600080fd5b5060043610610074576000357c01000000000000000000000000000000000000000000000000000000009004806317044a8c14610079578063181f2e721461014c57806341e0d08e1461026d578063a8bc2e7b1461033c578063f37676b7146104ea575b600080fd5b6101326004803603602081101561008f57600080fd5b81019080803590602001906401000000008111156100ac57600080fd5b8201836020820111156100be57600080fd5b803590602001918460018302840111640100000000831117156100e057600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f820116905080830192505050505050509192919290505050610654565b604051808215151515815260200191505060405180910390f35b6101786004803603602081101561016257600080fd5b810190808035906020019092919050505061068a565b604051808060200180602001858152602001848152602001838103835287818151815260200191508051906020019080838360005b838110156101c85780820151818401526020810190506101ad565b50505050905090810190601f1680156101f557808203
@YazzyYaz
YazzyYaz / daily_mined_blocks.sql
Last active February 22, 2019 03:53
Daily Mined Blocks Ethereum Classic
WITH greater_than_million AS (
SELECT TIMESTAMP_TRUNC(timestamp, DAY) AS block_day,
COUNT(*) AS gtm_blocks_mined
FROM `bigquery-public-data.crypto_ethereum_classic.blocks`
WHERE gas_used > 1000000
GROUP BY block_day
),
total_blocks AS (
SELECT TIMESTAMP_TRUNC(timestamp, DAY) AS day,
COUNT(*) AS total_blocks_mined
#standardSQL
-- MIT License
-- Copyright (c) 2019 Yaz Khoury, yaz.khoury@gmail.com
WITH miner_transaction_book AS (
SELECT miner,
DATE(timestamp) AS date,
SUM(transaction_count) AS total_mined_transactions
FROM `bigquery-public-data.crypto_ethereum_classic.blocks`
-- MIT License
-- Copyright (c) 2019 Yaz Khoury, yaz.khoury@gmail.com
WITH etc_transactions_book AS (
SELECT TIMESTAMP_TRUNC(timestamp, DAY) AS etc_block_day,
SUM(transaction_count) AS etc_total_daily_transaction_count
FROM `bigquery-public-data.crypto_ethereum_classic.blocks`
GROUP BY TIMESTAMP_TRUNC(timestamp, DAY)
),
@YazzyYaz
YazzyYaz / miner_reward_daily_gini.sql
Last active February 6, 2019 14:36
Daily Block Reward Gini
#standardSQL
WITH total_reward_book AS (
SELECT miner,
DATE(timestamp) as date,
COUNT(miner) as total_block_reward
FROM `bigquery-public-data.crypto_ethereum_classic.blocks`
GROUP BY miner, date
),
total_reward_book_by_date AS (
SELECT date,
@YazzyYaz
YazzyYaz / hashrate.sql
Last active February 5, 2019 22:27
Hashrate BigQuery for Ethereum Classic
#standardSQL
-- MIT License
-- Copyright (c) 2019 Yaz Khoury, yaz.khoury@gmail.com
WITH block_rows AS (
SELECT *, ROW_NUMBER() OVER (ORDER BY timestamp) AS rn
FROM `bigquery-public-data.crypto_ethereum_classic.blocks`
),
delta_time AS (
SELECT
@YazzyYaz
YazzyYaz / gini.sql
Created January 11, 2019 19:57
Gini Ethereum Sampled
with double_entry_book as (
select to_address as address, value as value, block_timestamp
-- debits
from `bigquery-public-data.ethereum_blockchain.traces`
where to_address is not null
and status = 1
and (call_type not in ('delegatecall', 'callcode', 'staticcall') or call_type is null)
union all
-- credits
select from_address as address, -value as value, block_timestamp