Skip to content

Instantly share code, notes, and snippets.

@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>
// The factorial binary builds solutions for the 2nd Curta gas-golfing course.
package main
import (
"fmt"
"math/bits"
"github.com/ethereum/go-ethereum/common"
. "github.com/solidifylabs/specops" //lint:ignore ST1001 SpecOps DSL is designed to be dot-imported
@PaulRBerg
PaulRBerg / autogen.sh
Created August 11, 2023 12:16
Shell script to generate Docusaurus site from NatSpec comments, see the original code: https://github.com/sablier-labs/v2-docs/blob/main/scripts/autogen.sh
#!/usr/bin/env bash
# Pre-requisites:
# - foundry (https://getfoundry.sh/)
# - rsync (https://github.com/WayneD/rsync)
# - pnpm (https://pnpm.io)
# - sd (https://github.com/chmln/sd)
# Strict mode: https://gist.github.com/vncsna/64825d5609c146e80de8b1fd623011ca
set -euo pipefail
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.19;
import "./PuzzleBox.sol";
// One word, or 32 bytes
uint256 constant ONE_WORD = 0x20;
// We lay out calldata in memory starting at this offset, immediately after the
// 4 byte function selector
@fiveoutofnine
fiveoutofnine / 1_example-glyphs.txt
Last active June 17, 2024 20:43
Quick snippets/tutorial on how to condense a font by selecting a subset of characters. First, create a `.txt` file with the characters (as unicode chars) you want included.
U+0039
U+003A
U+002F
U+0023
U+0050
U+0075
U+007A
U+006C
U+0065
U+0041
@pcaversaccio
pcaversaccio / ReturnBombExample.sol
Last active January 7, 2025 16:03
This is a returnbomb attack example.
// SPDX-License-Identifier: MIT
pragma solidity 0.8.19;
/**
* @title Returnbomb attack example
* @author pcaversaccio
*/
contract Evil {
uint256 public counter;
@rauchg
rauchg / README.md
Last active April 13, 2025 04:29
require-from-twitter