Skip to content

Instantly share code, notes, and snippets.

/*
* STATICCALL Proxy
*
* It expects the input:
* 256 bit - address
* 256 bit - gas
* 256 bit - value
* n bit - calldata to be proxied
*
* And returns the output:
@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 / 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/[email protected]/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 / 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 <[email protected]>
//
// 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 / get_solana_clock.py
Created October 3, 2024 04:53 — forked from SEJeff/get_solana_clock.py
Getting the Solana Proof of History clock time via the Clock sysvar
#!/usr/bin/env python3
# Uses construct and is a bit nicer code
import pytz
import pprint
import datetime
from construct import Int64ul, Int64sl, Struct
import requests
import base64
def main():