Skip to content

Instantly share code, notes, and snippets.

@nullun
nullun / index.js
Created December 30, 2023 16:53
Algorand TPS (defaults to 100 rounds)
import algosdk from 'algosdk';
const BLOCKRANGE = 100;
const blocks = [];
const algod = new algosdk.Algodv2(
'',
'https://mainnet-api.algonode.cloud',
443
);
@nullun
nullun / index.js
Created March 31, 2023 11:39
Calculating TxID for all transactions in a block, then verify those TxIDs exist.
import algosdk from 'algosdk';
const token = 'a'.repeat(64);
const address = 'http://192.168.1.100';
const port = 8080;
const client = new algosdk.Algodv2(token, address, port);
// Recursively remove all null values
function removeNulls(obj) {
@nullun
nullun / main.py
Created March 30, 2023 09:22
Block Fetcher with Transaction Parsing
from algosdk.v2client import algod
from algosdk import encoding
from algosdk import transaction
from typing import List, Dict, Union
import msgpack
import base64
token = ""
host = "https://mainnet-api.algonode.cloud"
client = algod.AlgodClient(token, host)
@nullun
nullun / gist:34cd94c6e1b0d6177a96b7d1e63e5463
Created November 1, 2022 09:56
CoinFabrik CTF Timeline
# CoinFabrik CTF
UTC
15:00:00 - Scheduled Launch
15:23:04 - CoinFabrik deploy Beginner CTF
15:29:14 - CoinFabrik deploy Advanced CTF
15:44:10 - CoinFabrik set-admin of Advanced CTF
@nullun
nullun / gist:0059a99105fe7ef9ed44ea44b658e20a
Created November 1, 2022 08:50
CoinFabrik Advanced CTF Dryrun with original admin
{
"accounts": [
{
"address": "2NIT4HHERNQ33CRO6NSD72U2EKK32NALF4IBO5XC6QWDRTJW726235XY5Y",
"amount": 1096000,
"amount-without-pending-rewards": 1096000,
"auth-addr": "ABS635VYWVL3CKPFMBCQFA5VXZ2AKXLY6M636KCRJ4ZP4VA2NUXMNWELQ4",
"min-balance": 100000,
"pending-rewards": 0,
"reward-base": 27521,
@nullun
nullun / gist:05ff66a91106f9c743b479502697d3a8
Created November 1, 2022 08:23
CoinFabrik Advanced CTF Dryrun
{
"accounts": [
{
"address": "NULLUNXT4G5YRQZMF7TOH774FDWLZLU3RE7IZ7TRMIAKWBVJBI7JMYWBFY",
"amount": 14998000,
"amount-without-pending-rewards": 14998000,
"min-balance": 100000,
"pending-rewards": 0,
"reward-base": 27521,
"rewards": 0,
@nullun
nullun / gist:6b2b72144d5d26cb5e5b6e99912f01f4
Created September 29, 2022 09:17
Algorand Asset OptIn using KMD (JS)
const algosdk = require('algosdk');
// Algod
algod_token = 'a'.repeat(64);
algod_server = 'http://127.0.0.1';
algod_port = 4001;
algod_client = new algosdk.Algodv2(algod_token, algod_server, algod_port);
// KMD
kmd_token = 'a'.repeat(64);
@nullun
nullun / demo.sh
Last active September 27, 2022 14:08
Demo: Fund Account, OptIn NFT, Send NFT in a single round
#!/usr/bin/env bash
set -e -u -x -o pipefail
SB=~/sandbox/sandbox
GOAL="${SB} goal"
# Use prefunded account
ACCT1=$(${GOAL} account list \
| grep '\[online\]' \
@nullun
nullun / Minimal-PyTeal-SDK-Demo.py
Created February 5, 2022 16:27
Minimal PyTeal and Python Algorand SDK demo
#!/usr/bin/env python3
from algosdk import *
from pyteal import *
# Account details (add your mnemonic here)
mn = ''
try:
pk = mnemonic.to_public_key(mn) # Public Key
sk = mnemonic.to_private_key(mn) # Secret Key