This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// SPDX-License-Identifier: MIT | |
pragma solidity ^0.8.7; | |
import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; | |
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol"; | |
import "@openzeppelin/contracts/access/Ownable.sol"; | |
library Base64 { | |
string internal constant TABLE_ENCODE = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'; | |
bytes internal constant TABLE_DECODE = hex"0000000000000000000000000000000000000000000000000000000000000000" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Node(): | |
def __init__(self,key): | |
self.key = key | |
self.left = None | |
self.right = None | |
self.parent = None | |
class Tree(): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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)) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# In this example we're sending some test bitcoins from an address we control to a brand new test | |
# address. We'll be sending the coins using the following address, public and private keys (please | |
# don't abuse). | |
# address : mtWg6ccLiZWw2Et7E5UqmHsYgrAi5wqiov | |
# public : 03bb318b00de944086fad67ab78a832eb1bf26916053ecd3b14a3f48f9fbe0821f | |
# private : 1af97b1f428ac89b7d35323ea7a68aba8cad178a04eddbbf591f65671bae48a2 | |
# 1. generate a one-shot dummy address we're going to send money to | |
$ curl -X POST http://api.blockcypher.com/v1/btc/test3/addrs | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const web3 = require('web3'); | |
const express = require('express'); | |
const Tx = require('ethereumjs-tx'); | |
const app = express(); | |
//Infura HttpProvider Endpoint | |
web3js = new web3(new web3.providers.HttpProvider("https://rinkeby.infura.io/YOUR_API_KEY")); | |
app.get('/sendtx',function(req,res){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#On Debian 7.0 | |
#Install build essentials | |
sudo apt-get install build-essential | |
#Install dependencies | |
sudo apt-get install binutils libproj-dev gdal-bin | |
sudo apt-get install libgeos-dev | |
sudo apt-get install libexpat1 libexpat1-dev | |
sudo apt-get install pkg-config |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pragma solidity ^0.4.0;//please import oraclizeAPI_pre0.4.sol when solidity < 0.4.0 | |
contract OraclizeI { | |
address public cbAddress; | |
function query(uint _timestamp, string _datasource, string _arg) payable returns (bytes32 _id); | |
function query_withGasLimit(uint _timestamp, string _datasource, string _arg, uint _gaslimit) payable returns (bytes32 _id); | |
function query2(uint _timestamp, string _datasource, string _arg1, string _arg2) payable returns (bytes32 _id); | |
function query2_withGasLimit(uint _timestamp, string _datasource, string _arg1, string _arg2, uint _gaslimit) payable returns (bytes32 _id); | |
function getPrice(string _datasource) returns (uint _dsprice); | |
function getPrice(string _datasource, uint gaslimit) returns (uint _dsprice); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import datetime | |
################################################################### | |
# | |
# Showing the way bits, difficulty, target, and hash work together. | |
# | |
################################################################### | |
print "Calculating target from bits, verifying the block's hash is valid, and verify the calculated difficulty." |
NewerOlder