You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When doing equivalance checking, the returndata of the two systems are
145
+
compared, and the calldata is set to be symbolic. This allows us to compare raw
146
+
bytecode as well -- the code does not need to adhere to the Solidity [ABI](https://docs.soliditylang.org/en/latest/abi-spec.html).
147
+
148
+
The following contract is written in raw assembly. It takes
149
+
the 1st byte of the calldata, multiplies it by 0, and stores it in memory, then
150
+
returns this value:
151
+
152
+
```
153
+
PUSH1 0x00
154
+
CALLDATALOAD
155
+
PUSH1 0x00
156
+
MUL
157
+
PUSH1 0x00
158
+
MSTORE
159
+
PUSH1 0x01
160
+
PUSH1 0x00
161
+
RETURN
162
+
```
163
+
164
+
This can be compiled into bytecode via e.g. [evm.codes](https://evm.codes/),
165
+
which allows us to both simulate this, and to get a bytecode for it: `60003560000260005260016000f3`. Notice that since anything multiplied by 0 is zero, for any calldata, this will put 0 into the returndata.
166
+
167
+
Let's compare the above code to an assembly contract that simply returns 0:
0 commit comments