Skip to content

Instantly share code, notes, and snippets.

View amanusk's full-sized avatar
🛠️
Building

amanusk amanusk

🛠️
Building
View GitHub Profile
@simon-something
simon-something / destroy.sol
Created December 8, 2021 13:23
'selfdestruct but still working'
// SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.7.0 <0.9.0;
contract Caller {
uint256 flag = 0;
event InsideBeforeDelegate();
event InsideAfterDelegate();
event OutsideAfterAllWtf();
@DanielVF
DanielVF / sample.md
Last active May 16, 2025 19:03
Sample Vulnerability Report

Impact

CRITICAL! Almost all USDC liquidity on the REKT/USDC uniswap pool can be stolen, due to an authorization issue with burnFrom() on the REKT token.

Background

Uniswap v2 pools get the prices for their swaps by comparing the relative amounts of each of the two tokens that they hold. If the pool holds very little of token A, and a lot of token B, then it only takes a little of token A to buy a lot of token B.

Currently REKT and USDC are fairly priced in the pool. If there were to suddenly be very little REKT in the pool, but the same amount of USDC, then very little REKT would be able to buy a lot of USDC.

# add this to your hardhat config
# compilers: [
# {
# version: "0.8.13",
# settings: {
# viaIR: true,
# outputSelection: {
# "*": {
# "*": ["irOptimized"],
# },
@amanusk
amanusk / cairo_vim_env.md
Last active February 20, 2023 13:51
Cairo Env for Vim

Setting up Cairo env for vim development

Setup the cairo virtualenv

First things first, you need to install the cairo-lang package, preferably in a virtual env you can later use and upgrade. Currently only python 3.7 and 3.8 is supported

python3 -m venv ~/cairo_venv
source ~/cairo_venv/bin/activate
@b-j-roberts
b-j-roberts / cairo.vim
Last active November 20, 2024 13:05
Cairo 1 vim syntax highlighting
" Vim syntax file
"
" Language: CAIRO
if exists("b:current_syntax")
finish
endif
syntax include @python syntax/python.vim