Info for developers
IMPORTANT The EVM version of the ONINO blockchain does not support Solidity pragmas > 0.8.19
A quick important note from the Solidity team’s official announcement blog on PUSH0
:
The new compiler switches the default target EVM version to Shanghai, which means that the generated bytecode will include
PUSH0
opcodes.
With the new PUSH0
opcode, the goal is to have:
Adequate mechanism of pushing zero onto the stack,
Reduced contract bytecode size as we can replace quite a few opcodes with just PUSH0,
Minimizing the use of DUP instructions for duplicating zeros on the stack, etc
It is an instruction with just one specific job, i.e., to push the constant value ZERO onto the stack.
In the following sections, we will delve deeper into the significance of this seemingly simple opcode and explore its crucial implications.
If you take a quick look at the opcodes related to PUSH operations, that we had so far (Instruction 0x60 to 0x7f), you will realize we had opcodes from PUSH1 to PUSH32.
This technically means, we had ways to PUSH any item from 1 byte to 32 bytes onto the stack by using the respective opcode as per our need.
In case you are wondering why would we even want to PUSH zero value onto the stack, you should check out EIP3855 for more details on the same as there are many instances where ZERO is required on the stack for imperative operations.
A part of the EIP3855 documentation says:
To put the “waste” into perspective, across existing accounts 340,557,331 bytes are wasted on
PUSH1 00
instructions, which means 68,111,466,200 gas was spent to deploy them. In practice, a lot of these accounts share identical bytecode with others, so their total stored size in clients is lower, however, the deploy time cost must have been paid nevertheless.
Last updated