Questions tagged [opcode]

operation codes specify the instructions to be performed in machine languages

22 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
4
votes
1answer
43 views

Copy and deploy a smart contract from opcodes without source code

I extracted opcodes from an already existing and deployed smart contract and I would like to know if it is possible to deploy an exact copy of this contract from its opcodes? My extracted opcodes ...
4
votes
3answers
394 views

convert bytes to uint8[8] using mstore()

I know how to convert bytes to uint8[8] using mload but mstore seemed like it could be more gas efficient. Is something like this possible? function bytesToUintArray(bytes input) returns (uint8[8])) ...
2
votes
0answers
21 views

How does addition look like at the opcode level in Solidity v0.8 and above?

In Solidity v0.7 and below, addition was a simple opcode: ADD Which cost 3 gas units and didn't handle overflows, silently returning the overflown value. But Solidity v0.8 made addition overflow-safe....
2
votes
0answers
106 views

What is the difference between the STATICCALL and CALL EVM opcodes?

Besides the regular and very common CALL, the Ethereum Virtual Machine has the STATICCALL opcode. In which ways does it differ from the regular CALL? Edit: This is not a duplicate because this ...
2
votes
0answers
51 views

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 ...
2
votes
1answer
404 views

How to deploy contract with bytecode from etherscan?

For example, I want to deploy a contract to my local testnet. But I only have its opcode from etherscan. How to deploy the contract with just those runtime bytecode?
2
votes
2answers
135 views

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 ...
2
votes
0answers
144 views

Is it possible to get compiler version from the bytecode and smart contract code?

The problem is that I have deployed some contract on the etherscan.io some time ago. Now I want to verify it, so I need to specify: Smart contract code Compiler version ABI encoded constructor ...
2
votes
0answers
215 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 ...
2
votes
0answers
142 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/...
1
vote
1answer
16 views

How do I send funds from a contract to an account using bytecode?

The instruction CREATE will send funds to a new account. Is there another instruction for sending funds to an account that already exists? Or I just have to use CREATE as if the account doesn't exist?
1
vote
0answers
27 views

Why JUMP opcode costs more than the rest

Looking here, most of the basic opcodes are 3 while JUMP is 8. Wondering why this is, why the 3x multiplier on this instruction.
1
vote
0answers
34 views

Code scope in evm

Short question, how is code scope defined/determined by the compiler when looking at EVM opcodes (or rather bitcode)? Is it simply by looking out for jump calls or return statements? Or does it define ...
1
vote
1answer
229 views

What happens in CALL when gas is set to 0?

Reading the documentation on the CALL opcode : "call contract at address a with input mem[in..(in+insize)) providing g gas and v wei and output area mem[out..(out+outsize)) returning 0 on error (eg. ...
0
votes
0answers
26 views

invalid opcode error

I would like to set array contents using data present in another one. I'm tring to use the function below but got opcode error. Can anyone explain me why? function getfreecars() public returns(uint) { ...
0
votes
0answers
14 views

What is the purpose of EVM tags, their haphazard arrangement and their relationship to functions?

I want to understand the purpose of tags in EVM assembly and their relationship with Solidity function. pragma solidity ^0.5.1; import './Mod.sol'; contract MOFTest{ ModifiedBank mb; ...
0
votes
0answers
20 views

Remix (or any other tool): Solidity program to EVM opcode

I am interested in obtaining sequence of opcodes for a Solidity program: One example is given in the following program obtained from Link of paper I have attached the image also I need a link to a ...
0
votes
0answers
35 views

Does the EVM have an opcode to check private key signatures?

I have plain and simple desire. I want my dapp users to be able to generate some data payload, sign it with their private key, and send it using any external channel (eg JSON between apps) to a ...
0
votes
1answer
158 views

gasCost of opcode “STATICCALL” in Geth VM Trace

{ "pc": 4765, "op": "STATICCALL", "gas": 222711, "gasCost": 219243, "depth": 1, ... } As above, Geth VM Trace (https://etherscan.io/vmtrace?txhash=...
0
votes
0answers
20 views

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 ...
0
votes
2answers
42 views

Are current ethereum opcodes prices in pyethereum updated?

I am not an expert in opcodes for Ethereum, but I am wondering if their prices here [https://github.com/ethereum/pyethereum/blob/develop/ethereum/opcodes.py] are updated as the latest version used by ...
0
votes
0answers
320 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 *...