Skip to content

Instantly share code, notes, and snippets.

@benjiqq
benjiqq / nli.md
Last active June 18, 2023 05:06
NLI - Netlisp

draft

Purpose

NetLISP (NLI) is a a lisp like language. It is similar to clojure/edn in that its intended primarily as a data format. It is intended to be passed between nodes in a blockchain/p2p context. For now it is some subset of lisp/clojure to be quick to implement. No GC, no complex types etc.

NetLISP needs to be implemented on the host in rust and in javascript at the same time. The parser can be shared between JS/client and the host via WASM.

The language needs to map expressions to protocols which are handled by the endpoints. Since the network defines the peers and client/server we can assume a common library with Rust/RustWASM.

@benjiqq
benjiqq / Pcert.sol
Last active June 2, 2023 05:47
launch swap
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.5;
//import "@openzeppelin/contracts/math/SafeMath.sol";
//import "../lib/InitializableOwnable.sol";
//import "../lib/SafeMath.sol";
@benjiqq
benjiqq / lisps.md
Last active June 14, 2023 04:17
rust lisps
@benjiqq
benjiqq / sha256.cu
Created June 1, 2023 16:17 — forked from allanmac/sha256.cu
A CUDA SHA-256 subroutine using macro expansion
// -*- compile-command: "nvcc -m 32 -arch sm_35 -Xptxas=-v,-abi=no -cubin sha256.cu"; -*-
//
// Copyright 2013 Allan MacKinnon <allanmac@alum.mit.edu>
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
@benjiqq
benjiqq / FairlaunchPool.sol
Created May 17, 2023 15:08 — forked from platodev2/FairlaunchPool.sol
Magnet Fairlaunch contract
// SPDX-License-Identifier: MIT
pragma solidity 0.8.5;
import "OpenZeppelin/openzeppelin-contracts@4.3.0/contracts/access/Ownable.sol";
//NRT is like a private stock
//can only be traded with the issuer who remains in control of the market
//until he opens the redemption window
contract NRT is Ownable {
@benjiqq
benjiqq / dis.py
Created May 15, 2023 06:12
tweet_discord.py
import discord
from discord.ext import commands, tasks
import asyncio
import tweepy
import csv
import json
import time
#auth.set_access_token(access_token, access_token_secret)
@benjiqq
benjiqq / feex.txt
Created January 12, 2023 05:59
fees explain
lets say the network is live
and there are 10 users who only send money back and forth
each tax brings let's say 0.01$
i.e. $0.10 per day in revenue
$3 a month
you can then virtually buy the right to earn the $3. let's say you pay $2 and make $1 profit
i.e. the $2 goes back into a treasury, the $1 is profit for the validator.
next month 100 users. profit now $30/month
the validator speculates on the revenue, and people bid what they believe is worth validating
i.e. everyone can participate as a node.. completely different than in PoW and PoS
@benjiqq
benjiqq / generic_json_parsing.go
Created January 10, 2023 14:56 — forked from alexhudici/generic_json_parsing.go
Example of generic Golang json parsing
package main
import (
"encoding/json"
"reflect"
"fmt"
)
type GenericObj struct {
Overwrite interface{} `json:"overwrite"`
@benjiqq
benjiqq / http.py
Created January 10, 2023 06:00
http with rust python
import http.client
import json
conn = http.client.HTTPSConnection('www.httpbin.org')
headers = {'Content-type': 'application/json'}
foo = {'text': 'Hello HTTP #1 **cool**, and #1!'}
json_data = json.dumps(foo)
@benjiqq
benjiqq / launch.md
Last active December 26, 2022 04:17
launch horizon

Horizon will be a new blockchain with its native currency (HRZ). Before mainnet launch there will be an erc20 token (EHRZ). There will be a conversion event where 1 ERHZ will be converted to 1 HRZ at genesis block of the new chain.

There will be a token on the ETH chain with a total supply of 1B. 100% of the supply will be minted at launch and added to the Uniswap V2 pool. The contract requires an initial amount of ETH (or USDC).

There will a token contract with a maxWallet setting (2%). Addtionaly there is a treasury contract, taxes go to treasury.

There is a special adjustment to give extra incentives to longterm contributors (early sell tax). Because the marketcap initially is very low there is penalty for early sellers. Anyone who buys in the first 5 days will be added to a record and the extra tax applies when selling.