This file contains hidden or 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
| #!python3 | |
| import hashlib | |
| import math | |
| import sys | |
| from base64 import b64decode, b64encode | |
| prooffile = "proof.txt" # File where Merkle proof will be written. | |
| MAXHEIGHT = 20 # Max height of Merkle tree |
This file contains hidden or 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 fetchLatestBlock = () => | |
| fetch(`https://blockchain.info/q/latesthash?cors=true`) | |
| .then(r => r.text()); | |
| const fetchMerkleRootAndTransactions = block => | |
| fetch(`https://blockchain.info/rawblock/${block}?cors=true`) | |
| .then(r => r.json()) | |
| .then(d => [d.mrkl_root, d.tx.map(t => t.hash)]); | |
| const random = arr => |
This file contains hidden or 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
| mkdir node1 node2 | |
| geth account new --datadir ./node1 | |
| geth account new --datadir ./node2 | |
| puppeth | |
| export mytestnet.json | |
| geth init --datadir "./node1" mytestnet.json |
This file contains hidden or 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
| # Copyright 2018-2020 Cargill Incorporated | |
| # | |
| # Licensed under the Apache License, Version 2.0 (the "License"); | |
| # you may not use this file except in compliance with the License. | |
| # You may obtain a copy of the License at | |
| # | |
| # http://www.apache.org/licenses/LICENSE-2.0 | |
| # | |
| # Unless required by applicable law or agreed to in writing, software | |
| # distributed under the License is distributed on an "AS IS" BASIS, |
This file contains hidden or 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 pyteal import * | |
| from pyteal.ast.bytes import Bytes | |
| from pyteal_helpers import program | |
| def approval(): | |
| # local variable for each users | |
| # global_owner = Bytes("owner") # byteslice | |
| # local_owner = Bytes("owner") # byteslice | |
| # local_balance = Bytes("balance") # uint64 |
This file contains hidden or 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 algosdk = require('algosdk') | |
| // const dotenv = require("dotenv"); | |
| // const fs = require("fs"); | |
| const algosdk = require("algosdk"); | |
| // dotenv.config(); | |
| //SMART CONTRACT DEPLOYMENT | |
| // declare application state storage (immutable) | |
| const localInts = 0; |
This file contains hidden or 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.4; | |
| import "@openzeppelin/contracts/utils/math/SafeMath.sol"; | |
| import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; | |
| contract Steezy is ERC20 { | |
| using SafeMath for uint256; | |
| address public owner; | |
| mapping(address => bool) public whitelistedAddresses; |
This file contains hidden or 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
| # 1) Update Ubuntu's database of software | |
| sudo apt-get update | |
| # 2) Install tmux | |
| sudo apt-get install -y tmux | |
| # 3) Install Docker | |
| sudo apt install -y docker.io | |
| # 4) Start and Automate Docker | |
| sudo systemctl start docker && sudo systemctl enable docker | |
| # 5) Change permissions for docker (optional) | |
| # Allow docker commands without requiring sudo prefix |
This file contains hidden or 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
| // Interface Class | |
| package javaapplication1; | |
| import java.util.ArrayList; | |
| public interface In1 { | |
| final static ArrayList<Integer> arrli = new ArrayList<Integer>(); | |
| } | |
| //first class |
This file contains hidden or 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<windows.h> | |
| #include <GL/glut.h> | |
| #include<math.h> | |
| void init2D(float r, float g, float b) | |
| { | |
| glClearColor(r,g,b,0.0); | |
| glMatrixMode (GL_PROJECTION); | |
| gluOrtho2D (-500, 500.0, -500, 500.0); | |
| } |