Skip to content

Instantly share code, notes, and snippets.

@bshastry
Created March 1, 2024 08:35
Show Gist options
  • Save bshastry/eb86066428cd15e62d890a7c953a3f3e to your computer and use it in GitHub Desktop.
Save bshastry/eb86066428cd15e62d890a7c953a3f3e to your computer and use it in GitHub Desktop.
Yul code that makes EVM run out of gas
==== Source: su0.yul ====
{
let al0 := verbatim_1i_1o(hex"31", 8)
function af0(ai0, ai1, ai2) -> ao0
{
let al1, al2, al3, al4, al5, al6, al7, al8, al9, al10, al11 := verbatim_10i_11o(hex"89", eq(verbatim_2i_1o(hex"10", ai1, 544), lt(192, 384)), af0(create2(196, 384, 193, 992), byte(832, 288), exp(256, 960)), call(gas(), 7, 247, 320, 24, 384, 135), byte(tload(320), delegatecall(gas(), 6, 320, 173, 192, 163)), mload(224), byte(mload(128), or(448, 832)), blobbasefee(), sload(160), shr(mload(128), eq(480, 128)), ai2)
let al12 := verbatim_1i_1o(hex"40", gt(verbatim_0i_1o(hex"64ddeb13295d"), verbatim_0i_1o(hex"7641c62b293953bb6d76d01a758b807b442ced6cd35d82d9")))
{
}
let al13 := af0(mload(256), create2(226, 352, 99, tload(288)), create(176, 320, 98))
sstore(992, or(basefee(), mload(320)))
}
tstore(sload(288), gt(shl(352, 1024), or(128, 32)))
{
}
let al14, al15, al16, al17, al18, al19, al20, al21, al22, al23, al24, al25, al26 := verbatim_13i_13o(hex"9B", create2(214, 384, 68, blobhash(143)), shl(blobbasefee(), keccak256(224, 175)), verbatim_1i_1o(hex"54", al0), or(verbatim_0i_1o(hex"70033551cfc33d9eb834b490085d296e538d"), exp(512, 256)), mload(320), af0(delegatecall(gas(), 4, 128, 50, 224, 157), exp(992, 480), eq(352, 928)), al0, keccak256(224, 126), shl(or(864, 320), al0), mload(288), blobhash(21), selfbalance(), al0)
let al27 := mload(128)
let al28, al29, al30, al31, al32, al33 := verbatim_6i_6o(hex"94", create2(183, 256, 144, byte(1024, 640)), call(gas(), 5, 206, 384, 229, 128, 65), lt(lt(608, 768), gt(64, 160)), blobhash(46), tload(160), eq(blobbasefee(), eq(224, 64)))
pop(tload(192))
}
// ====
// language: yul
// seed: 344883238
// yul-optimizations: V:
// ----
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment