CRYPTO NEWS

Maple Finance Loans $300m to help Struggling Bitcoin Miners


The lending fund is designed to support crypto mining firms impacted by the market downturn. (Read More)

Contract Deployment Bytecode

contract Example { uint256 public exampleNumber; constructor(){ exampleNumber = 1; } } For deploying the contract above we have following bytecodes : PUSH1 0x80 PUSH1 0x40 MSTORE CALLVALUE DUP1 ISZERO PUSH2 0x10 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH1 0x1 PUSH1 0x0 DUP2 SWAP1 SSTORE POP PUSH1 0xB2 DUP1 PUSH2 0x27 PUSH1 0x0 CODECOPY::Listen

contract Example {      uint256 public exampleNumber;     constructor(){         exampleNumber = 1;     } } 

For deploying the contract above we have following bytecodes :

PUSH1 0x80 PUSH1 0x40 MSTORE CALLVALUE DUP1 ISZERO PUSH2 0x10 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH1 0x1 PUSH1 0x0 DUP2 SWAP1 SSTORE POP PUSH1 0xB2 DUP1 PUSH2 0x27 PUSH1 0x0 CODECOPY PUSH1 0x0 RETURN INVALID

At highlighted section of the bytecode, evm initializes exampleNumber state variable to 1. Before SSTORE opcode we need to make stack in [0,1] form. To doing that, we pushed [0,1] then some duplication and swap operations. I want to ask is it necessary to make duplication and swap and why we do that, while we can push [0,1] and use SSTORE opcode.

Maple Finance Loans $300m to help Struggling Bitcoin Miners

Shopping cart
There are no products in the cart!
Continue shopping
0