Questions tagged [opcode]

operation codes specify the instructions to be performed in machine languages

177 questions
8
votes
1 answer

Ethereum opcode: meaning of first few instructions?

Looking at the opcode level, the first few instructions of any smart contracts start with this: push1 80 push1 40 mstore I understand that this saves 0x80 to address 0x40, but what is this all for? I looked into the Ethereum Yellow paper, but it…
user311703
  • 379
  • 2
  • 9
4
votes
1 answer

Why Yul doesn't have the else block?

The yul documentation states: No “else” block can be defined. It seems really weird. Yul has much more complex control flow schemes like loops and switches. Also other EVM languages like Solidity support the else blocks and they compile to EVM's…
CodeSandwich
  • 183
  • 1
  • 4
2
votes
0 answers

What do last few opcodes of a smart contract do?

I built a sample smart contract, then I looked at the opcodes, and always found similar opcodes at the end - for all samples I tried - like below. a1 log1 65 62 7a 7a 72 30 58 push6 627a7a723058 20 sha3 8b dup12 Nowhere in the contract refers…
user311703
  • 379
  • 2
  • 9
2
votes
2 answers

CALL instruction push GAS to stack?

According to https://ethervm.io, when CALL instruction is executed, the stack layout like this: [address, value, argOffset, argLen, retOffset, retLen] So CALL would pop 6 words from stack bottom to retrieve necessary information. But when I looked…
user311703
  • 379
  • 2
  • 9
2
votes
2 answers

Why return to String need so many operations when develop a smart contract?

I found a smart contract. The address is '0x2fabe69843e9a74a35b89145cb52e5568986c7a1'. I am really confused about is that why it need over 3000 lines Opcode to when Created this smart contract? Like some operation 'Balance' it didn't show in the…
0
votes
0 answers

What is the OP_CODE for getting another account (storage and/or code)?

I'm debugging solidity opcode by opcode. How do I tell when the compiler is referencing another smart contract through OpCode? I know that you can do this in Browser Solidity. However I would just like to know the OpCode for "pointing" to data…
nick carraway
  • 1,065
  • 1
  • 9
  • 23
0
votes
1 answer

What is after RETURN opcode?

I compiled a simple smart contract with --bin option (vs --bin-runtime), and looked at the assembly code. I can see that at first, the "setup" code copy all the run-time code with CODECOPY to memory, then RETURN; STOP. But what happen after RETURN;…
user311703
  • 379
  • 2
  • 9