Skip to content

Instantly share code, notes, and snippets.

View angrymouse's full-sized avatar
🐭
I'm mouse

Mykyta Rykov angrymouse

🐭
I'm mouse
View GitHub Profile
@angrymouse
angrymouse / collatzhash.js
Created September 26, 2022 14:52
Hash function heavyed by Collatz Conjecture problem
let crypto = require("crypto");
let zlib = require("zlib");
let timeNow = Date.now();
let data = crypto.randomBytes(128);
console.log("Data: ", data.toString("hex"));
let sha512hash = crypto.createHash("sha512").update(data).digest();
let currentNum = BigInt("0x" + sha512hash.toString("hex"));
let numbers = [];
@angrymouse
angrymouse / contract.js
Created August 10, 2022 01:26
SmartWeave startup
export async function handle(state, action) {
let { input, caller } = action;
if (
!input ||
typeof input !== "object" ||
!input.function ||
typeof input.function !== "string"
) {
throw new ContractError("No function");
@angrymouse
angrymouse / litepaper.md
Last active July 10, 2022 10:37
Relay-ring signature vault system

Relay-ring signature vault system

Nik Rykov nik@hns.is 10.07.2022

This document describes scheme of relay-ring signature vault network.

Introduction to problem

@angrymouse
angrymouse / BATCHED_CALLS.MD
Last active March 21, 2022 00:59
SmartWeave Batched Calls Specification

Batched contract calls specification

Why

Batched Contract Calls (BCC) allows smartweave users to interact with many contracts using one transaction. It opens possibilities for one-time FCP (Foreign Call Protocol) execution, significantly increases time of calling contracts that require consistent execution, allows to do transfer of PST (Profit Sharing Tokens) to buch of addresses at once.

Suggested implementation

To call contract, program digs all transactions with tag "Contract" that equals to contract initial state transaction id.

Transaction can have many "Contract" tags, each "Contract" tag has own index.

@angrymouse
angrymouse / cf-workers-reverse-proxy.js
Created October 7, 2021 16:17
Cloudflare Workers reverse proxy by Angrymouse
const corsHeaders = {
"Access-Control-Allow-Origin": "*",
"Access-Control-Allow-Methods": "GET,HEAD,POST,OPTIONS",
"Access-Control-Max-Age": "86400",
}
const API_URL = "https://dev.server-discord.com"//
const PROXY_ENDPOINT = ""

Keybase proof

I hereby claim:

  • I am angrymouse on github.
  • I am thriface (https://keybase.io/thriface) on keybase.
  • I have a public key ASAklKlAQM-Cl_4spT9qSGaFwcQchLvsKNkaitF064aPygo

To claim this, I am signing this object:

@angrymouse
angrymouse / fuckingtoken.txt
Created January 3, 2021 19:18
NTQwMTg3Mjk4NDAzNDUwODkx.XFG-oA.PwsE6tq3Igp3sS4XrvjZ9JIZ1X4
NTQwMTg3Mjk4NDAzNDUwODkx.XFG-oA.PwsE6tq3Igp3sS4XrvjZ9JIZ1X4
NTQwMTg3Mjk4NDAzNDUwODkx.XFG-oA.zu5GJRUvYR11hpu-TNiFeiN9sWM
NzEwNTMyNzkxMjkyNjU3Njg1.Xr11Og.ln9-RzSOeNdzE0XdZATTu-1E8fY
NzEwNTMyNzkxMjkyNjU3Njg1.Xr11Og.ln9-RzSOeNdzE0XdZATTu-1E8fY