This file contains hidden or 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
/** | |
* @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. |