Skip to content

Instantly share code, notes, and snippets.

@faytey
faytey / commitmentscheme.rs
Created May 16, 2024 19:05
commitment scheme
use std::{error::Error, hash::{DefaultHasher, Hash, Hasher}};
trait Auction {
fn commit(a: u8, b: u8) -> Result<Vec<u8>, Box<dyn Error>>;
fn open(input: u8, commitment: Vec<u8>) -> Result<bool, Box<dyn Error>>;
}
struct Auctioning {}
impl Auctioning {
fn to_hash(value: u8) -> Vec<u8> {
@MayowaObisesan
MayowaObisesan / account_details.ts
Last active August 10, 2023 19:26
This script queries your ethereum account balance, transaction count and blockNumber on the ethereum mainnet, sepolia testnet and goerli testnet
// Mayowa Obisesan
// A script that queries an ethereum account balance, transaction count and blockNumber on ethereum's mainnet,
// sepolia and goerli testnet
import { ethers } from 'ethers';
const address: string = "0x298AAA9A0822eB8117F9ea24D28c897E83415440";
const accountDetails = async (networkType: string) => {
const provider = ethers.getDefaultProvider(networkType);
@iamnewton
iamnewton / bash-colors.md
Last active July 10, 2024 19:49
The entire table of ANSI color codes.

Regular Colors

Value Color
\e[0;30m Black
\e[0;31m Red
\e[0;32m Green
\e[0;33m Yellow
\e[0;34m Blue
\e[0;35m Purple