Skip to content

Commit

Permalink
♻️ Fix CallContextChecker EIP-7702 check (#1356)
Browse files Browse the repository at this point in the history
  • Loading branch information
Vectorized authored Feb 17, 2025
1 parent 30a0de6 commit 29b5dbe
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/utils/CallContextChecker.sol
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,9 @@ contract CallContextChecker {
/// @solidity memory-safe-assembly
assembly {
extcodecopy(address(), 0x00, 0x00, 0x20)
result :=
and(eq(0xef0100, shr(232, mload(0x00))), lt(sub(extcodesize(address()), 1), 23))
// Note: checking that it starts with hex"ef01" is the most general and futureproof.
// 7702 bytecode is `abi.encodePacked(hex"ef01", uint8(version), address(delegation))`.
result := eq(0xef01, shr(240, mload(0x00)))
}
}

Expand Down

0 comments on commit 29b5dbe

Please sign in to comment.