Skip to content

Instantly share code, notes, and snippets.

View pcaversaccio's full-sized avatar
πŸ’―
Percent Commitment

sudo rm -rf --no-preserve-root / pcaversaccio

πŸ’―
Percent Commitment
View GitHub Profile
@cleanunicorn
cleanunicorn / remove_node_modules.sh
Created March 28, 2023 08:33
Remove node_modules for infinite new space
#!/bin/bash
echo "Searching for node_modules directories..."
find . -type d -name "node_modules" -prune -exec echo "Removing {}" \; -exec rm -rf {} \;
echo "All node_modules directories have been removed."
#!/bin/bash
alias c='code .'
alias cdh='cd $HOME'
alias ls='ls -la'
alias sl="ls"
alias cls='clear'
alias g='git status'
alias gap='git add -p'
alias gl='git log'
@DanielVF
DanielVF / erc20.sol
Last active February 7, 2023 21:25
Event Only Cursed ERC20
pragma solidity >=0.8.17;
// Cursed ERC20 that does everything in events.
// by @danielvf, based solmate by @transmissions11
abstract contract ERC20 {
event Transfer(address indexed from, address indexed to, uint256 amount);
event Approval(address indexed owner, address indexed spender, uint256 amount);
string public name;
β–Άforge test --match-test testFuzzDistributeTokenMultipleAddressesSuccess -vvvvv
[β ’] Compiling...
[⠊] Compiling 86 files with 0.8.17
[⠘] Solc 0.8.17 finished in 27.91s
Compiler run successful
Running 1 test for test/utils/BatchDistributor.t.sol:BatchDistributorTest
[FAIL. Reason: Assertion failed. Counterexample: calldata=0xcc173d850000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000054a0000000000000000000000001804c8ab1f12e6bbf3894d4083f33e07309d1f3800000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000028000000000000000000000000000000000000000000000000000000000000026a0000000000000000000000000000000000000000000000000000000000000371000000000000000000000000000000000000000000000000000000000065737300000000000000000000000000000000000000000000000000000000000014b800000000000000000000000000000000000000000000000000000000000016a60000000000000000000000000000000000000000000000000
@ItsCuzzo
ItsCuzzo / disassembler.py
Created December 24, 2022 06:08
EVM Bytecode Disassembler
opcodes = {
0x00: 'STOP',
0x01: 'ADD',
0x02: 'MUL',
0x03: 'SUB',
0x04: 'DIV',
0x05: 'SDIV',
0x06: 'MOD',
0x07: 'SMOD',
0x08: 'ADDMOD',
@devanoneth
devanoneth / pre-commit
Created November 11, 2022 04:11
Pre-commit hook for Foundry
#!/bin/bash
BWHITE='\033[1;37m'
RED='\033[0;31m'
GREEN='\033[0;32m'
NC='\033[0m'
printf "Running ${BWHITE}forge fmt${NC}... \n"
if forge fmt &>/dev/null; then
printf "${GREEN}Formatted!${NC} \n"
// SPDX-License-Identifier: MIT
pragma solidity 0.8.17;
// Used in the `name()` function
// "Yul Token"
bytes32 constant nameLength = 0x0000000000000000000000000000000000000000000000000000000000000009;
bytes32 constant nameData = 0x59756c20546f6b656e0000000000000000000000000000000000000000000000;
// Used in the `symbol()` function
// "YUL"
@cwhinfrey
cwhinfrey / bridge_hacks.md
Last active February 10, 2026 13:02
Bridge Hack List
@Amxx
Amxx / UniversalWrapper.sol
Last active August 9, 2023 08:08
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.7+commit.e28d00a7.js&optimize=false&runs=200&gist=
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/interfaces/IERC20.sol";
import "@openzeppelin/contracts/interfaces/IERC721.sol";
import "@openzeppelin/contracts/interfaces/IERC721Receiver.sol";
import "@openzeppelin/contracts/interfaces/IERC1155.sol";
import "@openzeppelin/contracts/interfaces/IERC1155Receiver.sol";
import "@openzeppelin/contracts/token/ERC1155/ERC1155.sol";