Skip to content

Instantly share code, notes, and snippets.

View Theo6890's full-sized avatar

Théo RICHARD Theo6890

View GitHub Profile
@Theo6890
Theo6890 / SOLIDITY_VERSION.md
Last active February 26, 2026 16:22
Latest safe Solidity 0.8.x to use in production

Safest Versions To Use

Currently use 0.8.27 or 0.8.34. Avoid all versions in between.

  • 0.8.27: Use if you don't need custom storage namespaces (ERC-7201, Diamond) or Solidity custom layouts (layout at).
  • 0.8.34: Use if you need features introduced >=0.8.28.

Reasoning Behind Version Choices

0.8.26 vs 0.8.27

@Theo6890
Theo6890 / 00_instructions.md
Last active March 6, 2026 20:08
Best practices to follow by AI agents in solidity - based on Foundry and Secureum best practices

Copilot Instructions — Org-Wide Conventions

This is the routing index for all instruction modules. It is automatically loaded as Tier 1 context. Detailed rules live in the module files under .github/instructions/.


Instruction Modules

| File | Scope | Rule IDs | Primary Consumers |

@Theo6890
Theo6890 / auto-approve-safe.json
Last active February 19, 2026 00:19
Agent Safe Auto-Approve Command List
"chat.tools.terminal.autoApprove": {
"nl": true,
// ============ PIPE CHAIN SUPPORT ============
"chat.tools.terminal.allowPipeChains": true,
"chat.tools.terminal.validatePipeSegments": true,
// ============ BASIC SYSTEM COMMANDS ============
"cd": true,
"echo": true,

List local stale branches:

git branch -vv | grep 'gone' | awk '{print $1}'

List and delete local stale branches

git branch -vv | grep "gone" | awk '{print $1}' | xargs git branch --delete
@Theo6890
Theo6890 / solidity-math-lib.md
Created April 21, 2025 22:54
Math lib solidity
Advantages Disadvantages
ABDKMath, Q64.64 • 64 decimals• should be the most gas efficient: what about casting uint256 => int128?
@Theo6890
Theo6890 / BGT.sol
Created January 2, 2025 15:08 — forked from larrythecucumber321/BGT.sol
PoL Contracts (Sep 22)
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;
// chosen to use an initializer instead of a constructor
import { OwnableUpgradeable } from "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";
// chosen not to use Solady because EIP-2612 is not needed
import {
ERC20Upgradeable,
IERC20,
IERC20Metadata
@Theo6890
Theo6890 / Swap.sol
Last active November 4, 2024 16:12
EIP712 Solidity & JS
pragma solidity 0.8.23;
import {EIP712} from "openzeppelin-contracts/utils/cryptography/EIP712.sol";
import {ECDSA} from "openzeppelin-contracts/utils/cryptography/ECDSA.sol";
contract Swap is EIP712 {
constructor() EIP712("Hand 2 Hand Exchange", "1") {}
struct Data {
IERC721 nft;

Audit Methodology

The Kaju Katli Approach

Notice the shape

  1. We start from the bottom, approach the middle become large and then again become narrow down going to the top.
  2. That means, I do not study the docs or try to get the larger picture about the protocol in the beginning.I completely avoid that.
@Theo6890
Theo6890 / Merkle_merkleRoot.t.sol
Created April 19, 2023 01:05
Fuzz & differential testing for Merkle Tree, passing array from foundry (solidity) test to js script. Contains JS code at the end of the file
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.17;
import {MerkleProof} from "openzeppelin-contracts/utils/cryptography/MerkleProof.sol";
// install murky with: `forge install dmfxyz/murky --no-commit `
import {Strings2} from "murky/differential_testing/test/utils/Strings2.sol";
import {Strings} from "openzeppelin-contracts/utils/Strings.sol";
import "forge-std/Test.sol";
/**
*
* @param {ethers.Wallet} wallet
* @param {ethers.BigNumber} chainId
* @param {string} verifyingContract
* @returns {string} full signature
*
* rewards is an object: {
id: ethers.BigNumber,
amount: ethers.BigNumber,