Questions tagged [opcode]

operation codes specify the instructions to be performed in machine languages

Filter by
Sorted by
Tagged with
2
votes
1answer
181 views

Why does the EVM program counter not increase by one but by two in PUSH1 opcode?

In the tutorial here, the program counter increases by 2 for a PUSH1 opcode. Then it increases by 1 for other opcodes. Why is this? Does it have to do with the opcodes size in memory? Aren't they all ...
1
vote
2answers
141 views

filter to restrict output of opcode data only to contracts/functions called by local node

Having modified the instructions.go file in geth I'm able to see the execution time of individual opcodes, it looks like this: My interpretation of that output is that it represents the execution of ...
0
votes
0answers
313 views

log output of modified function to geth console

To analyze the execution time of different opcodes I've created the following modifications to the go-ethereum file instructions.go: func opAdd(pc *uint64, evm *EVM, contract *Contract, memory *...
5
votes
1answer
176 views

Are new Opcodes approved in EIP's implemented in Solidity before they are introduced in a hardfork?

REVERT, STATICCALL, RETURNDATASIZE and RETURNDATACOPY are all approved and pending the next Ethereum hardfork as specified here However, the Solidity changelogs shows all 4 of these opcodes entering ...
3
votes
1answer
267 views

evaluation of execution speeds for various opcodes in EVM

Using traceTransaction we can get the following data: debug.traceTransaction("0x0cec118d22fbd572bf25c7e4143919e608989bec7da08512f2a6f3171df3b3b8") { gas: 104030, returnValue: "...
2
votes
1answer
202 views

geth console flag/option to output all opcodes executed in call to contract or function invocation

What I'd like to do is analyze all the opcodes that are executed when I call a contract, or call a function from a contract. According to my understanding, this computation would happen on my own ...
2
votes
0answers
211 views

analysis of the opcodes used in smart contract execution on ropsten, geth

I've deployed the following verified smart-contract to ropsten: contract Incrementer { uint iteration; function Incrementer() { iteration = 0; } function increment(uint ...
3
votes
1answer
558 views

Why doesn't bytecode match the opcodes on Etherscan?

I'm just going through the first few opcodes on this contract: https://etherscan.io/address/0xab7c74abc0c4d48d1bdad5dcb26153fc8780f83e#code. Which are (according to the opcodes view): PUSH1 0x60 ...
4
votes
1answer
288 views

Why does the init code of a contract change for Solidity > 0.4.5?

I have a simple empty contract: contract test { } That I compile on Remix using different versions. I notice that the compiled output is getting more and more complex with later compiler versions: ...
1
vote
1answer
2k views

Where are the opcode 0xfe and 0xfd documented?

The Solidity documentation has the following: Internally, Solidity performs a revert operation (instruction 0xfd) for a require-style exception and executes an invalid operation (instruction ...
4
votes
3answers
454 views

Can a transaction have a negative fee?

I know there are some opcodes that have negative gas costs (see this). So if I send a transaction that calls one (or multiple) instance(s) of these opcodes, will the gas used be negative? i.e. will my ...
2
votes
1answer
645 views

Internal message call CALL opcode

I am trying to make sense of a contacts internal messaging. The contract is sending 6.6 ether to the address that invoked the contract. From what I understand, the CALL opcode carries out a ...
3
votes
2answers
470 views

Can the CALL opcode be used to create a contract?

The Yellow Paper Appendix H defines the CREATE and CALL opcodes. For CALL: the operand order is: gas, to, value, in offset, in size, out offset, out size. By setting the second operand (the "to"...
29
votes
1answer
11k views

Is there a table of EVM instructions and their gas costs?

The EVM instructions are in the yellow paper, or they are summed up in this answer. But their gas costs are not there. Where can I find a list of all instructions with their associated gas costs?
5
votes
1answer
385 views

Can a contract fetch the global block gas limit?

The OPCODE GASLIMIT gets the block's gas limit. Could in-line assembly, uint gasLimit; assembly { gasLimit := gaslimit } fetch the gas limit ? contract B { function ...
12
votes
3answers
3k views

what is block.timestamp

In a function, does block.timestamp record the time the transaction was processed, or the time the block.timestamp computational step was processed? Is block.timestamp the time the transaction is ...
7
votes
1answer
249 views

Why a contract with only one variable produces lots of EVM code?

Why does a 'void' contract we have a long bytecode with many duplicated opcodes? For instance, the following contract: pragma solidity ^0.4.0; contract A { string s="s"; } will be translated ...
2
votes
1answer
401 views

Is there any available sandbox for Ethereum's OPCODES?

In case of Bitcoin, there are few tools, which allow you to play with Script OPCODES - one, two. So, is there any handy way to simulate / debug Ethereum's OPCODES execution?
2
votes
2answers
1k views

Recursive call ends with `VM Exception: invalid opcode`

I am running f: contract Test { function f() { f(); } } which produces VM Exception: invalid opcode in browser-solidity. Is that a bug or expected behavior?
3
votes
1answer
462 views

Ethereum Ddos attack

I have a background in security, so i try to understand what is hapeneing to Ethereum project. Recently, i heard that Ethereum will make a fork to stop the Ddos attack. here i want to know how the ...
6
votes
1answer
532 views

What are the two arguments to a RETURN opcode?

The RETURN opcode in the EVM takes 2 arguments(ie, consumes two elements from the stack), but what do they represent? I tried to understand the yellow paper describing them, but I don't understand the ...
3
votes
1answer
716 views

Ethereum's Storage: is SSTORE updates only at the post-transaction state?

I'm trying to figure out from Ethereum's yellow paper (Homestead edition) how does its storage model works (NOT memory model). It seems that the storage is updated only once, after a transaction is ...
1
vote
2answers
330 views

Create a contract at a defined address?

Is it possible to define a smart contract at a predictable address? 0xf0 CREATE in the Yellow Paper suggests that the address is deterministically determined by x = A(Ia, σ[Ia]n) page 29 of http://...
2
votes
0answers
128 views

Possible to create new contract via a proposal in the ethereum.org/dao framework?

Is it possible to deploy contracts from within contracts, using something like p.recipient.call.value(p.amount * 1 ether)(bytecode); This article says so, https://blog.ethereum.org/2015/12/04/...
4
votes
1answer
499 views

Why are there missing opcodes when using the disassembler on bytecode from the blockchain?

I'm using the disassembler from go-ethereum repo which fails on about 20% of the bytecode from the blockchain with missing/unknown opcodes. The disassembler on Etherscan fails as well. Is there an ...
8
votes
1answer
213 views

When does a SUICIDE opcode becomes effective?

The documentation (https://github.com/ethereum/wiki/wiki/Subtleties) states that SUICIDE becomes effective at the end of the transaction, but in block 116525, the same contract was able to SUICIDE ...
8
votes
1answer
652 views

Is the cost of updating storage different than the cost of adding to storage?

Do these have a separate cost? sstore(1, 10) # first time adding a value to storage with this key sstore(1, 20) # changing the value in storage. I looked for a list of gas costs / opcodes, and the ...
2
votes
0answers
80 views

Is there a decompiler for the binary data in the blockchain [duplicate]

I want to know if there is a decompiler for the binary data in the blockchain, I want to know about the details of my contract after it was uploaded to the blockchain?
18
votes
2answers
1k views

What does bytecode of blank contract do?

When I compile a blank contract: contract A {} with solc --optimize --optimize-runs 300000 --opcodes test.sol I get: PUSH1 0x60 PUSH1 0x40 MSTORE PUSH1 0x6 DUP1 PUSH1 0x10 PUSH1 0x0 CODECOPY ...
8
votes
1answer
899 views

Can a contract access the code of another contract?

Using web3.js, the EVM (bytecode) of a contract can be obtained by web3.eth.getCode(addressOfContract). Can this be performed by a contract using the address of another contract? If so, how? ...
8
votes
1answer
666 views

Are linkable ring signatures available in Ethereum?

Are transactions with ring signatures available in Ethereum? There should be as anonymity/fungibility is important. Also, I think Vitalk Buterin mentioned it may be possible to implement an EVM ...
35
votes
2answers
3k views

What's a precompiled contract and how are they different from native opcodes?

The Yellow Paper states: These are four so-called ‘precompiled’ contracts, meant as a preliminary piece of architecture that may later become native extensions. The four contracts in addresses ...
54
votes
5answers
14k views

How can you decompile a smart contract?

On the blockchain I can inspect the code of a contract, and see the EVM opcodes. Is there a way to decompile this and convert it back to (Solidity) source code?
59
votes
2answers
21k views

What OPCODES are available for the Ethereum EVM?

The Ethereum virtual machine has a large number of operation codes and base level instruction sets. Is a complete listing available?

1
2