Skip to content

Instantly share code, notes, and snippets.

View ikwuoz's full-sized avatar

Emmanuel Ikwuoma ikwuoz

View GitHub Profile
@ikwuoz
ikwuoz / main.rs
Last active June 30, 2026 15:12
Minimal rust bin snippet for sigterm bug validation
use std::time::Duration;
use tokio::signal::unix::{signal, SignalKind};
use tokio::time::sleep;
use tokio_util::sync::CancellationToken;
fn main() {
let rt = tokio::runtime::Builder::new_current_thread()
.enable_all()
.build()
.unwrap();
@ikwuoz
ikwuoz / keybase.md
Last active May 15, 2024 10:41
keybase

Keybase proof

I hereby claim:

  • I am nuel-ikwuoma on github.
  • I am nuel_0x (https://keybase.io/nuel_0x) on keybase.
  • I have a public key ASBzy0lIoGB45-lTJZXRrDXwTlAKzGZWgZ7zzXmNhqyBAwo

To claim this, I am signing this object:

@ikwuoz
ikwuoz / contracts-gist...Savings.sol
Created May 21, 2023 07:23
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.8.18+commit.87f61d96.js&optimize=false&runs=200&gist=
// SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.8.2 <0.9.0;
import {IPermit2} from "./permit2.sol";
import {IERC20} from "./permit2.sol";
contract Savings {
IPermit2 public permit2;
uint256 withdrawTimestamp;
// SPDX-License-Identifier: AGPL-3.0-only
pragma solidity ^0.8.7;
import "https://github.com/maple-labs/erc20/blob/main/contracts/interfaces/IERC20.sol";
/*
███████╗██████╗ ██████╗ ██████╗ ██████╗
██╔════╝██╔══██╗██╔════╝ ╚════██╗██╔═████╗
█████╗ ██████╔╝██║ █████╔╝██║██╔██║
██╔══╝ ██╔══██╗██║ ██╔═══╝ ████╔╝██║
███████╗██║ ██║╚██████╗ ███████╗╚██████╔╝
{"abi": [
{
"inputs": [],
"stateMutability": "nonpayable",
"type": "constructor"
},
{
"inputs": [
{
"internalType": "address",
@ikwuoz
ikwuoz / calculateInterface.sol
Last active March 4, 2023 03:46
Interface ID calculations for EIP6160 standard
// Minimal interface for role-based access control for smart contracts
// -https://github.com/polytope-labs/EIPs/blob/master/EIPS/eip-5982.md
interface IERC_ACL_CORE {
function hasRole(bytes32 role, address account) external view returns (bool);
function grantRole(bytes32 role, address account) external;
function revokeRole(bytes32 role, address account) external;
}
// Interface for consistent mint and burning for token standards
// -https://github.com/polytope-labs/EIPs/blob/master/EIPS/eip-5679.md
@ikwuoz
ikwuoz / bitPackingAlpha.sol
Last active October 10, 2022 10:29
hex bit slicing for smol gas saving
// Execution Cost: ~25200
// Logic is to divide the packedbits using a hex denomitor that effectively slices out byte sections from it
// ex: In decimal (1024 / 10^2 = 10), since evm works with 32bytes hex, we use a power of 16 here i.e (result / 16^n)
// for hex division slicing
uint constant eightBytesSlice = 0x10000000000000000;
uint constant sixteenBytesSlice = 0x100000000000000000000000000000000;
uint constant twentyfourBytesSlice = 0x1000000000000000000000000000000000000000000000000;
did:3:kjzl6cwe1jw14ax3lxtpsnkoei2or34dw07srzcd2hh77n765kgs15wugggvaea