Skip to content

Instantly share code, notes, and snippets.

@Philogy
Philogy / address.md
Created April 3, 2026 15:03
My Ethereum Address (ETHSecurity Badge Holder Proof)

0xc3FfD59Bd2ab6FB4187672723276D953142FDdde

@Philogy
Philogy / LICENSE_PSL.md
Last active April 7, 2026 12:52
Permission Software License (Draft)

Permissionless Software License 1.0

Parameters

Field Value
Licensor [Full legal name of licensor]
Licensed Work [Project name and version] — © [Year] [Licensor].
Change Date [YYYY-MM-DD]
Unlock Address [Ethereum address (0x…)]
@Philogy
Philogy / main.rs
Created April 1, 2026 19:34
Wonderland CTF EVMVM Solution Address Bruteforcer
use alloy_primitives::{Address, Keccak256, U256, keccak256, uint};
use k256::elliptic_curve::BatchNormalize;
use k256::elliptic_curve::sec1::ToEncodedPoint;
use k256::{AffinePoint, ProjectivePoint};
use rayon::prelude::*;
use std::time::Instant;
const BATCH: usize = 128;
/// Compute `len_slot - data_slot` (saturating) for a given address.
@Philogy
Philogy / SwapBackdoorHook.sol
Created December 18, 2025 13:51
Hook to let you insert swaps into position manager modify liquidities batch
// SPDX-License-Identifier: MIT
pragma solidity =0.8.30;
import {IHooks, PoolKey, ModifyLiquidityParams, BalanceDelta} from "v4-core/interfaces/IHooks.sol";
import {Hooks} from "v4-core/libraries/Hooks.sol";
import {IPoolManager, SwapParams} from "v4-core/interfaces/IPoolManager.sol";
import {toBalanceDelta} from "v4-core/types/BalanceDelta.sol";
/// @author philogy <https://github.com/philogy>
contract SwapBackdoorHook {
from math import sqrt
def dy(c: float, l: float, u: float) -> float:
if c < l:
return 0
if l <= c < u:
return sqrt(c) - sqrt(l)
return sqrt(u) - sqrt(l)
@Philogy
Philogy / GolfBounty.sol
Last active March 15, 2024 02:38
Curta Golf Bounty Contract
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;
import {ICurtaGolf} from "curta-golf/src/interfaces/ICurtaGolf.sol";
import {ICourse} from "curta-golf/src/interfaces/ICourse.sol";
import {IERC721} from "./interfaces/IERC721.sol";
import {SafeTransferLib} from "solady/utils/SafeTransferLib.sol";
import {SafeCastLib} from "solady/utils/SafeCastLib.sol";
/// @author philogy <https://github.com/philogy>
@Philogy
Philogy / uniswap-v3-fees.py
Created January 17, 2024 20:05
Very simple model of Uniswap V3 Fees
from attrs import define
@define
class Tick:
fee_growth_outside: int
def cross(self, fee_growth_global: int):
self.fee_growth_outside = fee_growth_global - self.fee_growth_outside
@Philogy
Philogy / Broken.s.sol
Created January 16, 2024 21:25
Unable to deploy because of simulation script
// SPDX-License-Identifier: MIT
pragma solidity 0.8.20;
import {Script} from "forge-std/Script.sol";
import {Test} from "forge-std/Test.sol";
import {console2 as console} from "forge-std/console2.sol";
contract Counter {
uint256 public count;
(defn _double [:uint256 x] :uint256 [:internal :pure]
(* x 2))
(defn add [:uint256 x] :uint256 [:external :pure]
(if (< x 10) 0 (self/_double x)))
@Philogy
Philogy / NFT_ERC6909.sol
Created January 6, 2024 11:29
EIP6909 Implementation optimized for IDs with a totalSuppy of 1 each (collection of purely non-fungible tokens
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
/// @notice Simple EIP-6909 for IDs that are solely non-fungible.
/// @author Forked from Solady (https://github.com/vectorized/solady/blob/main/src/tokens/ERC6909.sol)
/// @author philogy <https://github.com/philogy>
///
/// @dev Note:
/// The ERC6909 standard allows minting and transferring to and from the zero address,
/// minting and transferring zero tokens, as well as self-approvals.