Content pfp
Content
@
0 reply
0 recast
2 reactions

Michael Amadi pfp
Michael Amadi
@michaels
Here's an interesting way to encode all of the supported opcodes of an EVM chain in 256 bits. This is that of Ethereum mainnet currently. Base 2: 1110010000111111000000000000000000000000000000000000000000000000000000000000000000000000000111111111111111111111111111111111111111111111111111111111111111111111111111111111111100000111111111111111111111111111000000000000000100111111111111110000111111111111 Base 10: 103238640842065774761881656312677524192904604960857204817777740543577286447103 Base 16: 0xe43f0000000000000000001fffffffffffffffffffff07ffffff00013fff0fff Its also easy to check if a particular `opcode` is supported, like so: ``` uint256 opcodesBitmap = 103238640842065774761881656312677524192904604960857204817777740543577286447103; uint256 mask = shl(opcode, 0x01); bool isSupported = and(opcodesBitmap, mask); return isSupported; ```
1 reply
0 recast
4 reactions

Michael Amadi pfp
Michael Amadi
@michaels
POC of one that supports checking if an opcode is supported, supporting an unsupported opcode and deprecating an already supported one to get new opcodeBitmap values: https://github.com/AmadiMichael/OpcodesBitmap
0 reply
0 recast
3 reactions