This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define constant CNSTR_CODE = 0x601834818180333cf3 | |
#define constant CNSTR_CODE_SIZE = 0x9 | |
#define constant CNSTR_CODE_OFFSET = 0x17 // 0x20 - [CNSTR_CODE_SIZE] | |
#define macro MAIN() = takes(0) returns(0) { | |
[CNSTR_CODE_SIZE] [CNSTR_CODE_OFFSET] // [cc_offset, cc_size] | |
returndatasize // [0, cc_offset, cc_size] | |
[CNSTR_CODE] dup2 mstore // [0, cc_offset, cc_size] | |
dup3 dup3 dup3 create // [addr1, 0, cc_offset, cc_size] | |
pop create // [addr2] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define macro MAIN() = takes(0) returns(0) { | |
number returndatasize mstore | |
0x20 returndatasize return | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define macro MAIN() = takes(0) returns(0) { | |
returndatasize calldataload // [x] | |
not // [~x] | |
0x1 and // [even] | |
returndatasize mstore // [] | |
msize returndatasize return // [] | |
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/python3 | |
import sys | |
import pyperclip | |
def main(): | |
args = sys.argv | |
if len(args) != 2: | |
raise ValueError(f'Invalid argument count {len(args)} expected 2') | |
word = args[1] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
=================================================== | |
POTENTIALLY OUT-OF-DATE (last update: 2022-10-15). | |
PLEASE REFER TO THE FOLLOWING REPO: https://github.com/Philogy/concise-erc1967-proxies | |
=================================================== | |
*/ | |
#define constant IMPL_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc | |
#define macro CONSTRUCTOR() = takes (0) returns (0) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// SPDX-License-Identifier: MIT | |
pragma solidity 0.8.17; | |
// Used in the `name()` function | |
// "Yul Token" | |
bytes32 constant nameLength = 0x0000000000000000000000000000000000000000000000000000000000000009; | |
bytes32 constant nameData = 0x59756c20546f6b656e0000000000000000000000000000000000000000000000; | |
uint256 constant maxUint256 = 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// SPDX-License-Identifier: GPL-3.0-only | |
pragma solidity 0.8.15; | |
import {Test} from "forge-std/Test.sol"; | |
import {HuffDeployer} from "foundry-huff/HuffDeployer.sol"; | |
/// @author Philippe Dumonet <[email protected]> | |
contract ReverseTest is Test { | |
address reversooor; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Credit to karma (@0xkarmacoma) for the original code: twitter.com/0xkarmacoma/status/1584239664310779904 | |
Credit to kaden.eth (@0xKaden) for suggesting the use of msize: twitter.com/0xKaden/status/1584280521089376256 | |
*/ | |
#define macro reverse_word() = takes(1) returns(1) { | |
// [x0] | |
0x00ff00ff00ff00ff00ff00ff00ff00ff00ff00ff00ff00ff00ff00ff00ff00ff | |
dup2 dup2 and // [x1r, mask1, x0] | |
0x08 shl // [x1r', mask1, x0] | |
swap2 // [x1, mask1, x1r'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# @license MIT | |
# @author Philogy <https://github.com/Philogy> | |
from eth_utils.abi import function_signature_to_4byte_selector | |
from eth_utils.crypto import keccak | |
from math import ceil, log2 | |
import pyperclip | |
def find_reselector_nonce(selectors, mask): |
OlderNewer