Skip to content

Instantly share code, notes, and snippets.

View amanusk's full-sized avatar
😘
Training ... Unit ready

amanusk amanusk

😘
Training ... Unit ready
View GitHub Profile
@drgorillamd
drgorillamd / 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 January 21, 2024 07:07
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