Skip to content

Instantly share code, notes, and snippets.

View omgbbqhaxx's full-sized avatar
🪐
Universal

Yasin Aktimur omgbbqhaxx

🪐
Universal
View GitHub Profile
pragma solidity >=0.5.16 <0.6.9;
//INCONTRACTWETRUST4.0
interface tokenRecipient {
function receiveApproval(address _from, uint256 _value, address _token, bytes calldata _extraData) external;
}
contract EthereumeRush {
string public name;
string public symbol;
uint8 public decimals = 18;
pragma solidity ^0.6.3;
interface tokenRecipient {
function receiveApproval(address _from, uint256 _value, address _token, bytes calldata _extraData) external;
}
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
* This contract neet to support referals system for erush's fast growth.
*/
pragma solidity ^0.6.3;
interface tokenRecipient {
function receiveApproval(address _from, uint256 _value, address _token, bytes calldata _extraData) external;
}
contract EthereumPay {
string public name;
string public symbol;
uint8 public decimals = 18;
uint256 public totalSupply;
pragma solidity > 0.5.14;
contract eerminer {
function checklasttwentyblock() view public returns(bool, uint256) {
if(uint256(blockhash(block.number-1)) % 5200 == 1){
return (true, block.number-1);
}else if(uint256(blockhash(block.number-2)) % 5200 == 1){
return (true, block.number-2);
} else if(uint256(blockhash(block.number-3)) % 5200 == 1){
return (true, block.number-3);
@omgbbqhaxx
omgbbqhaxx / minePYTHON36.py
Created October 22, 2019 14:02 — forked from turunut/minePYTHON36.py
Example of how a Bitcoin block is mined by finding a successful nonce
import hashlib, struct, codecs
ver = 2
prev_block = "000000000000000117c80378b8da0e33559b5997f2ad55e2f7d18ec1975b9717"
mrkl_root = "871714dcbae6c8193a2bb9b2a69fe1c0440399f38d94b3a0f1b447275a29978a"
time_ = 0x53058b35 # 2014-02-20 04:57:25
bits = 0x19015f53
# https://en.bitcoin.it/wiki/Difficulty
exp = bits >> 24
@omgbbqhaxx
omgbbqhaxx / block.py
Created October 22, 2019 13:41 — forked from ChristopherJohnston/block.py
Example Blockchain hash calculations using Python
from hashlib import sha256
import time
import struct
import binascii
import datetime
VERSION = 1
def hexify(value, type):
return binascii.hexlify(struct.Struct(type).pack(value))
itemsRef.observe(DataEventType.value) { (snap:DataSnapshot!) -> Void
in
let getHistory = JSON(snap.value!)
//for (key,_):(String, JSON) in self.getHistory {
// self.keyArr.addObject(key)
//}
//self.myarr = self.keyArr.sort({Double($0 as! String)! > Double($1 as! String)!})
print(getHistory)
@omgbbqhaxx
omgbbqhaxx / bintree.py
Created July 29, 2019 16:00 — forked from samidhtalsania/bintree.py
Binary tree in Python
class Node():
def __init__(self,key):
self.key = key
self.left = None
self.right = None
self.parent = None
class Tree():
@omgbbqhaxx
omgbbqhaxx / tableView.swift
Last active July 15, 2019 08:38
TableViewBasics.
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return 3
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
@omgbbqhaxx
omgbbqhaxx / gist:7aba5c4d10259735ecc7d5bfc04ffdb3
Created June 21, 2019 12:57 — forked from omarbaruzzo/gist:a86a65d890ed823013315ea2d3727c2d
GenesisCalculator - code to be included in chainparams.cpp to calculate the genesis block, nnonce, merkle root etc.
#include "arith_uint256.h"//Mod.
//----------------------------------------------------------------------------------------------------------
//Mod.
/*
// calcolo del Blocco Genesi
// Resettiamo il valore del blocco
consensus.hashGenesisBlock = uint256S("0x");
std::cout << std::string("Iniziamo a calcolare il blocco:\n");
if (true && (genesis.GetHash() != consensus.hashGenesisBlock)) {