Skip to content

Instantly share code, notes, and snippets.

View buddies2705's full-sized avatar
🏠
Working from home

Gaurav buddies2705

🏠
Working from home
  • Bangalore
View GitHub Profile
/**
* @dev OpcodeChecker processes contract code to generate a bitmap of used opcodes.
*
* DO NOT USE: See the vulnerability identified by Recmo below. A patch will be provided soon.
*
* The generated bitmap can be used to enforce whitelisting and blacklisting on contract code.
* Bit n of the bitmap is set iff opcode n is used. For instance, the presence of the STOP opcode
* will result in bit 0 of the bitmap being set.
*
* A best-effort attempt is made to skip over unreachable data, but there may be false positives.